-
Notifications
You must be signed in to change notification settings - Fork 804
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
[prim,rtl] Rephrase a term in prim_reg_cdc.sv #25481
Conversation
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.
LGTM
Hi @vogelpi, Would you mind taking a look at this and checking the change is reasonable? If so, I'd really appreciate an explicit "change authorised" comment (and you are in a rather closer timezone than Matute!) |
hw/ip/prim/rtl/prim_reg_cdc.sv
Outdated
// be copied back. | ||
logic dst_to_src; | ||
if (DstWrReq) begin : gen_wr_req | ||
assign dst_to_src = src_busy_q && src_ack | src_update && !busy; |
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.
The functionality looks good to me (thanks for the clarifying comment above!) as src_update
can only ever be non-zero if DstWrReq
is 1.
But:
- We should convert the bitwise OR
|
here to a boolean OR||
for consistency. src_update
andbusy
are unused in caseDstWrReq
is 0. The latter is used in an assertion so lint may not realize this, the former should generate a lint error/warning that we should fix.
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.
- Oops about the
|
: thanks! - Good point about the unused signals. I've added an
unused_...
signal in the obvious way and can see a lint error go away. Thanks!
CHANGE AUTHORIZED: hw/ip/prim/rtl/prim_reg_cdc.sv This doesn't implement a functional change but helps to improve coverage. |
If DstWrReq is false then the src_update signal cannot be true. This is because it is driven by the src_update_o port on a prim_reg_cdc_arb instance. If DstWrReq is false then the instance wires src_update_o to zero (in the gen_passthru generate block). This rewrite will behave equivalently in the same way as before but will no longer generate any conditional coverage terms that depend on src_update if DstWrReq is false. Note that if DstWrReq is zero then the src_update and busy signals are constant zero and are no longer actually used. To avoid a lint error from the unused signals in this situation, they get "sampled" in the gen_passthru block. Signed-off-by: Rupert Swarbrick <[email protected]>
57bccd7
to
7119020
Compare
CHANGE AUTHORIZED: hw/ip/prim/rtl/prim_reg_cdc.sv |
This is trying to remove a coverage item that was a hole for some blocks that I was (wrongly) trying to waive with #25088. I hope this solution will be cleaner.
If DstWrReq is false then the src_update signal cannot be true. This is because it is driven by the src_update_o port on a prim_reg_cdc_arb instance. If DstWrReq is false then the instance wires src_update_o to zero (in the gen_passthru generate block).
This rewrite will behave equivalently in the same way as before but will no longer generate any conditional coverage terms that depend on src_update if DstWrReq is false.