-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the CsrManager for the Post-Processing SIMD datapath #6
Conversation
@xiaoling-yi maybe dumb comment, but are you also testing for negative input now? |
Very Cool! Maybe we should then instead provide this as a scala package that is installable via coursier at some point, instead of copying the source files in all three repos 😉 . |
@JosseVanDelm, no. Just randomly generated data test. There are tests for results going out of the output range so they are clamped accordingly in
Oh! I also think about this. Let me check how difficult it is! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Approve! But please check comments first 👀
val config_valid = WireInit(0.B) | ||
|
||
// check if the csr address overflow (access certain csr that doesn't exist) | ||
def startCsrAddr = (csrNum - 1).U |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when it overflows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will throw an error at simulation time.
// handle read requests: keep sending response data until the request succeeds | ||
when(read_csr) { | ||
io.csr_config_in.rsp.bits.data := csr(io.csr_config_in.req.bits.addr) | ||
io.csr_config_in.rsp.valid := 1.B | ||
}.elsewhen(keep_sending_csr_rsp) { | ||
io.csr_config_in.rsp.bits.data := csr_rsp_data_reg | ||
io.csr_config_in.rsp.valid := 1.B | ||
}.otherwise { | ||
io.csr_config_in.rsp.valid := 0.B | ||
io.csr_config_in.rsp.bits.data := 0.U | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the keep_sending_csr_rsp
take priority over the read_csr
? Because when the keep_sending_csr_rsp
is active then it should be the first one to come out right?
What happens when both read_csr
and keep_sending_csr_rsp
occur? Then the one that takes priority is the newest request? I think it should be the one in the buffered register.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When keep_sending_csr_rsp
, the io.csr_config_in.req.ready
is low so read_csr
will never be high. But good point!
@@ -14,4 +14,9 @@ object SIMDConstant { | |||
|
|||
// SIMD parallelism | |||
def laneLen = 64 | |||
|
|||
// csrManager parameters, we use 3 csr for Post-processing SIMD | |||
def csrNum: Int = 3 + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why separate 3+1?
It would be nice to have a description what these 3+1 are 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus 1 for status CSR!
Add the CsrManager for the Post-Processing SIMD datapath to be compatible with the SNAX CSR interface.
The CsrManager code is the same as for GEMM and Streamer!