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

[pinmux/tops] Move JTAG mux logic into pinmux strap logic #5486

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

msfschaffner
Copy link
Contributor

This is a continuation of the pinmux alignments tracked in #5221.

In particular, this moves moves the temporary JTAG mux logic into the pinmux, and removes the jtag_mux module, which was more sort of a helper for Bronze.

This PR is still WIP - I will ping you once this is ready to review.

@msfschaffner msfschaffner added Component:DV DV issue: testbench, test case, etc. Component:FPGA FPGA related issues Component:RTL labels Mar 6, 2021
@msfschaffner msfschaffner self-assigned this Mar 6, 2021
@msfschaffner msfschaffner force-pushed the jtag-mux branch 2 times, most recently from 7ee4aff to e91f9b0 Compare March 6, 2021 02:03
@msfschaffner msfschaffner force-pushed the jtag-mux branch 10 times, most recently from b8ce7cd to 5e05701 Compare March 10, 2021 01:27
@msfschaffner msfschaffner requested review from tjaychen and imphil March 10, 2021 01:27
// TODO: this is currently not supported.
// connect this to the correct pins once pinout is final and once the
// verilator testbench supports DFT/Debug strap sampling.
// See also #5221.
Copy link
Contributor Author

@msfschaffner msfschaffner Mar 10, 2021

Choose a reason for hiding this comment

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

This is a temporary fix, and I believe it does not affect our CI at this point, since we're not using the JTAG DPI there.

The issue is that the JTAG signals are still mapped onto the SPI signals due to the FTDI chip being used on the nexysvideo board. So now that we move the JTAG mux into the pinmux, the verilator testbench does not have access to the JTAG signals at the top level anymore.

However, in the final ASIC pinout the JTAG will be mapped to a different location (just regular MIOs). Hence, once that new pinout is in, I will uncomment this and remap the JTAG signals appropriately.

@msfschaffner msfschaffner marked this pull request as ready for review March 10, 2021 01:41
@msfschaffner msfschaffner force-pushed the jtag-mux branch 2 times, most recently from 3a24baf to 8db9a89 Compare March 10, 2021 02:51
@msfschaffner msfschaffner force-pushed the jtag-mux branch 2 times, most recently from b714afe to 0d319c9 Compare March 10, 2021 20:59
@@ -119,6 +115,11 @@ module pinmux_strap_sampling
continue_sampling_d = lc_ctrl_pkg::On;
end
end
// TODO: this can currently be overridden with a parameter for legacy reasons.

Choose a reason for hiding this comment

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

can you remind me why this has to be kept for now? is it because of fpga..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this is because FPGA and Verilator do not know anything about the discrete strap sampling event.
eventually this should be removed.

Choose a reason for hiding this comment

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

i thought the discrete vs continuously sampling was mostly an internally controlled thing though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is meant to be internally controlled, that's right - however the continuous sampling mode is currently only available in the TEST life cycle states, and only activates if the straps are nonzero upon the first sample event.

at the moment, the FPGA tests run in DEV state and switch between JTAG and SPI at runtime, which would not be compatible with the internally timed, discrete strap sampling that is enabled in DEV.

assign tap_strap = tap_strap_t'(tap_strap_q);
`ASSERT_KNOWN(TapStrapKnown_A, tap_strap)

always_comb begin : p_tap_mux
jtag_rsp = '0;
// Note that this holds the JTAGs in reset

Choose a reason for hiding this comment

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

just to confirm, this is the area we discussed where after a change, we recommend the system level issue a jtag reset to make sure the switch didn't cause any issues right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that's right!

k == TargetCfg.trst_idx ||
k == TargetCfg.tdi_idx ||
k == TargetCfg.tdo_idx) begin : gen_jtag_signal
assign in_core_o[k] = (jtag_en) ? TargetCfg.tie_offs[k] : in_padring_i[k];
Copy link

@tjaychen tjaychen Mar 10, 2021

Choose a reason for hiding this comment

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

is the idea here we want the pinmux side to see a fixed value when this pin is in use by jtag?
This is not a great example in this case..but you could technically imagine a case...where jtag might be used as a wakeup source (doesn't apply to us..so just humor me).

In that case, we probably would want the signal to feed through and actuate the downstream logic. Is there any harm in relying on downstream pinmux logic to just disable the input or maybe mux away? Maybe things are a bit more complicated if the backing pin is dedicated.

I dont think this is something that needs to be addressed in this PR yet, but might be worth filing an issue to look at waaaaaaaay later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, the pinmux side is tied off to a fixed value in this case.
However, what you mention regarding the wakeup detectors is already possible.
I.e., the wakeup taps are taken directly from the pad inputs, hence the JTAG mux does not affect them.

Choose a reason for hiding this comment

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

ah excellent, if wakeups are handled, there really isn't much of a problem then.

@@ -204,7 +204,17 @@
},
],
}

{ name: "rv_dm",

Choose a reason for hiding this comment

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

ah! glad someone one is using the "host" structure!

Choose a reason for hiding this comment

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

we are only....a few PRs away from fully automating the host instantiation! probably another day...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

jep ;)

localparam logic [pinmux_pkg::NumIOs-1:0] TieOffValues = pinmux_pkg::NumIOs'(1'b1 << (
pinmux_reg_pkg::NMioPads + top_earlgrey_pkg::TopEarlgreyDioPinSpiDeviceCsb));

// DFT and Debug signal positions in the pinout.

Choose a reason for hiding this comment

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

do you think in the future it makes sense to generate this from the new pinmux parsing structure you had in mind? Maybe that's exactly where you're headed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is exactly where I am headed - I just need a way to pass this in in a manual way for now

Copy link

@tjaychen tjaychen left a comment

Choose a reason for hiding this comment

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

LGTM with a few clarifying questions.

@tjaychen
Copy link

tjaychen commented Mar 11, 2021 via email

@msfschaffner msfschaffner merged commit bd440d2 into lowRISC:master Mar 11, 2021
vogelpi added a commit to vogelpi/opentitan that referenced this pull request Mar 18, 2021
The pads of the dedicated IOs and the capture trigger got accidentally
disconnected with lowRISC#5486.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit that referenced this pull request Mar 18, 2021
The pads of the dedicated IOs and the capture trigger got accidentally
disconnected with #5486.

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
Component:DV DV issue: testbench, test case, etc. Component:FPGA FPGA related issues Component:RTL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants