-
Notifications
You must be signed in to change notification settings - Fork 777
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
[dv,jtag] Change JTAG clock frequency to 24MHz #24580
Conversation
he current configured frequency of 50MHz is too fast and might not be supported by silicon. |
hw/dv/sv/jtag_agent/jtag_if.sv
Outdated
// jtag interface with default 50MHz tck | ||
interface jtag_if #(parameter int unsigned JtagDefaultTckPeriodPs = 20_000) (); | ||
// jtag interface with default 24MHz tck | ||
interface jtag_if #(parameter int unsigned JtagDefaultTckPeriodPs = 41_664) (); |
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.
Not that it necessarily matters for this round, but... This merely changes the defaults for a parameter. Shouldn't the value for earlgrey be set in some using module or elsewhere via the DV environment?
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.
For example, at these sites:
opentitan/hw/top_earlgrey/dv/env/chip_if.sv
Line 437 in 007358e
jtag_if jtag_if(); |
opentitan/hw/top_earlgrey/dv/env/chip_if.sv
Line 457 in 007358e
jtag_if flash_ctrl_jtag_if(); |
However, if we end up setting the value in any sequences, then this would get overridden anyway. It looks like we only do that in block-level tests right now, though.
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, I agree it might be good to do it differently at later stage. For now I tried to minimize the changes as much as possible.
What situation are you using this DV code in? Are you really sure that the numbers you change here have the effect you expect? For example, in the |
It failed during gate-level simulation since 50MHz frequency is too fast and is not supported. 24MHz is supported and works fine. |
Ah, I see. Presumably you are instantiating the interface in gate-level simulation with some code that configures it. The easiest approach is probably to choose a "GLS-suitable frequency" there. |
I don't have special tests, I am using existing tests like rom_raw_unlock in which the JTAG frequency is set by this interface. But maybe indeed it will be simpler to do the change under `ifdef GATE_LEVEL? |
Ah right, now I think I understand. If I've followed this correctly, the instantiation of For some bizarre reason, the original author of this interface made it "active", so that it drives its own TCK signal based on a configured frequency. Honestly, I think this is mad! But changing that is not a problem for today :-) Looking a bit further (grepping for I think we should probably be a little more explicit in DV land ("my chip JTAG frequency is XYZ"), but that's not really a problem for today either! But it would be nice to keep the fast-ish JTAG frequency in DV simulations: they are painfully slow already! If you can stick it under an |
c85f1c8
to
fd37b35
Compare
Yes, I agree the configuration should be done through a UVM agent. For now I added it under `ifdef GATE_LEVEL with a TODO comment. |
Signed-off-by: Sharon Topaz <[email protected]> [dv,jtag] Change JTAG clock frequency to 24MHz for GLS Signed-off-by: Sharon Topaz <[email protected]>
fd37b35
to
82e0fa9
Compare
Thanks for this. I've just opened an issue about the fact this needs sorting out and have force-pushed to this PR with a link to it. Merging without waiting for CI to run again (the diff shows I've just added a token to a comment!) |
Thank you for your help @rswarbrick . |
The current configured frequency of 50MHz is too fast and might not be supported by silicin.