-
Notifications
You must be signed in to change notification settings - Fork 812
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
[sdc] update sdc after PD review #24221
Conversation
Thanks @meisnere! Is there a reason why this SDC file isn't named |
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.
Thanks @meisnere ! This is a lot of constraints to review, I did a first pass and left some feedback.
# TODO | ||
# Add source delays for generated clocks |
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.
?
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.
This TODO has already been in the previous SDC file used for ES. @meisnere , @OTshimeon please comment on whether this is actually needed for the production tapeout.
7de35d6
to
442af2b
Compare
# TODO | ||
# Add source delays for generated clocks |
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.
This TODO has already been in the previous SDC file used for ES. @meisnere , @OTshimeon please comment on whether this is actually needed for the production tapeout.
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.
Thanks @meisnere and @OTshimeon for updating the PR. I did another pass and will now set up a shared document to continue the review of some items internally. To proceed with this PR, I need input from you on the following things:
- Please comment on the remaining open questions.
- Please run
util/fix_trailing_whitespace.py hw/top_earlgrey/syn/chip_earlgrey_asic.sdc
to remove trailing whitespaces. The PR currently fails lint and we can't merge it like this. For details, see the "checks" section below. - The constraints we've checked and approved last TUE in a meeting (they were in a different file previously) seem not to be part of this PR. Please explain why and what the planned course of action is here. My understanding was that these constraints need to be moved to this SDC file as well. FYI @moidx .
7e718bd
to
9a3c0f8
Compare
9a3c0f8
to
5e0f7c8
Compare
Add the last few missing constraints - line 1664 and below. |
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.
I've reviewed the JTAG clock (lines 199 - 268) related constraints. I have no concerns though a couple of questions.
We have these set_clock_sense
commands to tell the tool about inverted clocks in the LC and RV_DM JTAG TAPs:
opentitan/hw/top_earlgrey/syn/chip_earlgrey_asic.sdc
Lines 228 to 229 in 5e0f7c8
set_clock_sense -negative ${LC_JTAG_TCK_INV_PIN} | |
set_clock_sense -negative ${RV_JTAG_TCK_INV_PIN} |
What we don't have is an explicit create_generated_clock
for these. These clocks are derived from the incoming JTAG clock using a prim_clock_inv
:
opentitan/hw/vendor/pulp_riscv_dbg/src/dmi_jtag_tap.sv
Lines 190 to 197 in 3e047f4
prim_clock_inv #( | |
.HasScanMode(1'b1), | |
.NoFpgaBufG(1'b1) | |
) i_tck_inv ( | |
.clk_i ( tck_i ), | |
.clk_no ( tck_n ), | |
.scanmode_i ( testmode_i ) | |
); |
prim_clock_inv
instances).
I also don't see any constraints for trst_n which is connected to the IO4 pad. Should we have some? I don't see any obvious constraints around other resets so I presume this is fine but wanted to check.
Nope. I believe there is no need for a timing requirement for nTRST. It's an async reset, and the user is required to assert it only when TCK is inactive. Because the acceptable reset and guard times are on the order of hundreds of milliseconds, we give the tool freedom to place and route. |
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.
I reviewed the spi constraints section (L289 to 1569) and have no major concerns.
Most of my comments were just nits/suggestions, which can mostly be ignored to keep the diff small if needed.
The only non-nit was about different output_delay constraints for some of the if {$spec_constr}
blocks, which probably just needs a comment to articulate why.
|
||
# bidir ports | ||
set SPI_DEV_DATA_PORTS [get_ports {SPI_DEV_D0 SPI_DEV_D1 SPI_DEV_D2 SPI_DEV_D3}] | ||
if {$spec_constr} { |
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.
Nit. A documentation comment at the top of the file explaining the use of this switch (why/when the two sets of constraints are used) would be helpful.
Nit. Also, in most locations, the if/else is used to switch between the same command just with a different set of input variables. I think it may be easier to follow, and use fewer LoC, if a single set of variables were conditionally defined under one if/else block, and then the commands don't have to be duplicated each time.
set out_val 3 | ||
} | ||
|
||
set spi_host_inp_max 11.5 |
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.
Nit. this section is quite magical without additional context. Hopefully some of the rationale / calcs can move into additional visible collateral in the future.
-clock SPI_TPM_CLK -add_delay | ||
set_output_delay -max $spi_tpm_out_val_max [get_ports SPI_DEV_D1] \ | ||
-clock SPI_TPM_CLK -add_delay | ||
} | ||
# SPI TPM CSB, the chip-select for TPM mode. | ||
# Any muxed port could be a SPI TPM CSB, but we only guarantee IOA7 meets |
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.
Nit. This comment appears stale, given the addition of IOA2 below?
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.
I did have another look at this but could not find a reason why IOA2 should get these constraints. IOA2 doesn't seem to be related to SPI TPM at all. It's used a GPIO and in some cases we use it for SPI Host 1. But SPI Host 1 is not used for passthrough / TPM mode. This is only done for SPI device and SPI Host 0. So it's not clear to me why this is needed actually.
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 PD team got back to me about this: Some time in the past, IOA2 was determined to be used as chip select for quad SPI. During the tapeout, it was agreed that IOA7 should be the primary chip select target whereas IOA2 should remain as a secondary opportunistic target. I'll add a comment into the SDC to document this.
@@ -782,16 +930,28 @@ set_output_delay -min ${SPI_HOST_OUT_DEL_MIN} \ | |||
set_output_delay -max ${SPI_HOST_OUT_DEL_MAX} \ | |||
[get_ports "SPI_HOST_CS_L ${SPI_HOST_DATA_PORTS}"] \ | |||
-clock SPI_HOST_SLOW_PASS_CLK -add_delay | |||
|
|||
} else { |
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 else
case (and the one above on L909) do not have output_delay constraints. All other $spec_constr
if/else blocks duplicate the commands within each case. Is that intentional?
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.
Yes, it actually is intentional. The PD provided feedback on this. The spec_constr == 1
case in these two particular cases verifies the fast passthrough mode where the direct timing paths from an upstream host to a downstream Flash device is checked. The SPI Device is then defined as input and the SPI Host as output.
In contrast, the spec_constr == 0
case verifies the slow passthrough mode where the direct timing paths from a downstream Flash to an upstream host are checked. Then, the SPI device is defined as output and the SPI Host is defined as input. In this case, SPI Device gets no input delay constraints and SPI Host not output delay constraints.
I'll document this in the SDC.
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.
Ah, and the PD team also confirmed that both constraint sets got verified for the tapeout.
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.
I've been through the USB section of the SDC file (lines [53:121]) and checked all of the numbers and signals and I'm happy that the constraints are good. The critical signals have appropriate time constraints, with margins.
The cio_usb_sense_i
signal changes much less frequently than the other inputs and is not at all timing-critical, but over-constraining it is harmless.
The explanatory commenting in the USB section should be helpful to others, thank you.
619cd87
to
f4166c1
Compare
Signed-off-by: Eran Meisner <[email protected]>
For SPI_HOST1, I/O timing is only closed on pads IOB0, IOB1, IOB2, and IOB3. Signed-off-by: Andreas Kurth <[email protected]>
5cf77d1
to
cb9fba8
Compare
Thanks @hcallahan-lowrisc , @a-will , @GregAC , @alees24 for your reviews! I've included the obvious fixes and @andreaskurth appended another commit with additional constraints seperately discussed and approved by the PD team. We will merge this once CI passes. We will discuss the remaining questions and opens with the PD team in a follow-up. |
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.
Agree with @vogelpi. Thx all!
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. This is a follow-up of lowRISC#24221. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of lowRISC#24221. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of #24221. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of #24221. Signed-off-by: Pirmin Vogel <[email protected]> (cherry picked from commit 567f3b3)
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of lowRISC#24221. This is a cherry pick of commit c03805b to branch earlgrey_1.0.0. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of lowRISC#24221. This is a cherry pick of commit c03805b to branch earlgrey_1.0.0. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of #24221. Signed-off-by: Pirmin Vogel <[email protected]> (cherry picked from commit 567f3b3)
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of #24221. This is a cherry pick of commit c03805b to branch earlgrey_1.0.0. Signed-off-by: Pirmin Vogel <[email protected]>
Some of the constraints in the SDC file were not fully clear and this commit adds comments to provide relevant background information. In addition, the PrimeTime set_case_analysis waivers for SPI HOST 1 are moved to the section applied in PrimeTime only. This is a follow-up of lowRISC#24221. Signed-off-by: Pirmin Vogel <[email protected]>
Please review the two files, confirm them and use it for future sdc edits.
chip_earlgrey_asic.ot.sdc replaces the previous chip_earlgrey_asic.sdc