Skip to content
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

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

meisnere
Copy link

@meisnere meisnere commented Aug 6, 2024

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

@andreaskurth
Copy link
Contributor

Thanks @meisnere! Is there a reason why this SDC file isn't named chip_earlgrey_asic.sdc? That would provide a diff compared to what is currently in the repo

Copy link
Contributor

@vogelpi vogelpi left a 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.

hw/top_earlgrey/syn/ot.sdc_setup.tcl Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
Comment on lines 370 to 371
# TODO
# Add source delays for generated clocks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

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.

hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
hw/top_earlgrey/syn/chip_earlgrey_asic.ot.sdc Outdated Show resolved Hide resolved
@andreaskurth andreaskurth added the ManuallyCherryPick:earlgrey_1.0.0 This PR should be cherry-picked to the earlgrey_1.0.0 branch (no automation, manual coordination). label Aug 8, 2024
@meisnere meisnere force-pushed the ast_PR_240806 branch 4 times, most recently from 7de35d6 to 442af2b Compare August 26, 2024 16:15
hw/top_earlgrey/syn/chip_earlgrey_asic.sdc Outdated Show resolved Hide resolved
Comment on lines 370 to 371
# TODO
# Add source delays for generated clocks
Copy link
Contributor

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.

Copy link
Contributor

@vogelpi vogelpi left a 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 .

hw/top_earlgrey/syn/chip_earlgrey_asic.sdc Outdated Show resolved Hide resolved
@meisnere meisnere force-pushed the ast_PR_240806 branch 3 times, most recently from 7e718bd to 9a3c0f8 Compare August 29, 2024 14:39
@meisnere
Copy link
Author

meisnere commented Sep 3, 2024

Add the last few missing constraints - line 1664 and below.

Copy link
Contributor

@GregAC GregAC left a 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:

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:

prim_clock_inv #(
.HasScanMode(1'b1),
.NoFpgaBufG(1'b1)
) i_tck_inv (
.clk_i ( tck_i ),
.clk_no ( tck_n ),
.scanmode_i ( testmode_i )
);
and clearly will be slightly skewed relative to the non inverted clock. I presume this is something the tool can just handle in its analysis and doesn't need explicit constraints to do properly (or maybe we have suitable constraints that generically applied to all 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.

@a-will
Copy link
Contributor

a-will commented Sep 5, 2024

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.

Copy link
Contributor

@hcallahan-lowrisc hcallahan-lowrisc left a 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} {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

hw/top_earlgrey/syn/chip_earlgrey_asic.sdc Show resolved Hide resolved
@@ -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 {
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

@alees24 alees24 self-requested a review September 9, 2024 20:53
Copy link
Contributor

@alees24 alees24 left a 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.

@vogelpi vogelpi force-pushed the ast_PR_240806 branch 2 times, most recently from 619cd87 to f4166c1 Compare October 16, 2024 16:07
Eran Meisner and others added 2 commits October 16, 2024 18:50
For SPI_HOST1, I/O timing is only closed on pads IOB0, IOB1, IOB2, and
IOB3.

Signed-off-by: Andreas Kurth <[email protected]>
@vogelpi
Copy link
Contributor

vogelpi commented Oct 16, 2024

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.

Copy link
Contributor

@andreaskurth andreaskurth left a 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!

@andreaskurth andreaskurth merged commit 398a2b1 into lowRISC:master Oct 16, 2024
42 checks passed
vogelpi added a commit to vogelpi/opentitan that referenced this pull request Oct 31, 2024
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]>
vogelpi added a commit to vogelpi/opentitan that referenced this pull request Nov 4, 2024
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]>
vogelpi added a commit that referenced this pull request Nov 5, 2024
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]>
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
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)
vogelpi added a commit to vogelpi/opentitan that referenced this pull request Nov 5, 2024
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]>
vogelpi added a commit to vogelpi/opentitan that referenced this pull request Nov 5, 2024
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]>
vogelpi added a commit that referenced this pull request Nov 5, 2024
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)
andreaskurth pushed a commit that referenced this pull request Nov 12, 2024
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]>
andrea-caforio pushed a commit to andrea-caforio/opentitan that referenced this pull request Nov 12, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ManuallyCherryPick:earlgrey_1.0.0 This PR should be cherry-picked to the earlgrey_1.0.0 branch (no automation, manual coordination).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants