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

[hw,lc_ctrl,rtl] Unified LC CTRL for JTAG TAP and TLUL-based DMI #24507

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Razer6
Copy link
Member

@Razer6 Razer6 commented Sep 4, 2024

This PR cherry picks the changes from Darjeeling and adds them under a dedicated parameter to select between the JTAG Tap and the TLUL-based DMI interface.

When merging this, we might bump the version number of the IP.

Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

This looks sensible to me in general. The DV changes are small, but I think they are the right first steps. I'll let a designer review the design changes as well as me: they look right to me, but it probably makes sense for at least one other person to take a look.

@Razer6 Razer6 force-pushed the sync-lc-ctrl branch 13 times, most recently from 826cdca to 4238861 Compare October 12, 2024 09:24
@Razer6 Razer6 force-pushed the sync-lc-ctrl branch 4 times, most recently from 4986aec to 9094c99 Compare October 21, 2024 21:39
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

As a sort of "meta note": I see there are some opens listed in the commit message for the first commit, at least. Are these still open, and do you intend to work on them as part of this PR?


lc_ctrl_reg_top u_reg_tap (
// Statically MUX DMI TLUL port and the one coming from the JTAG TAP
Copy link
Contributor

Choose a reason for hiding this comment

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

Really minor nit, but I think we're using mux as a verb here (rather than e.g. a name), so it doesn't really need to be capitalised.

@@ -43,6 +43,10 @@ module tb;
assign lc_ctrl_if.otp_vendor_test_ctrl_o = otp_vendor_test_ctrl;
assign otp_vendor_test_status = lc_ctrl_if.otp_vendor_test_status_i;

// Used for JTAG DTM connections via TL-UL.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that maybe this commit ("Update DV environment") should be squashed with the first one. Otherwise, you end up with an intermediate state where the tests won't actually build.

I was going to suggest putting some stub version in the first commit, but I've looked at this commit more carefully and I'm now convinced it's easiest just to squash it in.

Copy link
Member Author

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.

Nit: I'm not sure the indentation is right here: the "registers: " line on line 692 hasn't moved horizontally but now the final closing brace is 2 characters to the left.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm puzzled. It looks right to me. A new level of indentation was added though.

@@ -25,7 +25,7 @@
{clock: "clk_kmac_i", reset: "rst_kmac_ni"}
]
bus_interfaces: [
{ protocol: "tlul", direction: "device" }
{ protocol: "tlul", direction: "device", name: "regs" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Crikey, this commit was big! If the rest of this PR gets held up at all, it might be worth splitting out this commit and getting it merged. I think it looks right, but it was long and I'd rather not read through it again :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the others are not that big?

@@ -184,7 +184,11 @@ class jtag_dtm_reg_dtmcs extends jtag_dtm_base_reg;
.access("RO"),
.mubi_access("NONE"),
.volatile(0),
`ifdef USE_DMI_INTERFACE
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder whether it would make sense to give the agent something like a "configure_use_dmi" function? Then we wouldn't need all the ifdefs: we could just call it with the correct value after construction, avoiding tangling the config so much with the construction.

Working through the items:

  • For the abits field, I think we'd just need set_reset?
  • For the n_bits default value override, this just goes through to the uvm_reg constructor. I think we can just use the larger value (with a comment)?
  • For the address field, I think we could just use the larger value again. It's the top field in the register, so I don't think that would cause a problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you help me in doing that on this PR?

hw/ip/lc_ctrl/dv/tb.sv Outdated Show resolved Hide resolved
@@ -96,6 +98,7 @@ module tb;

`DV_ALERT_IF_CONNECT()

`ifdef USE_DMI_INTERFACE
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to pull this into a localparam further up in the file with something like

`ifdef USE_DMI_INTERFACE
  localparam bit use_dmi_interface = 1'b1;
`else
  localparam bit use_dmi_interface = 1'b0;
`endif

That would cut down the amount of stuff that needed ifdef code.

@@ -404,6 +404,7 @@ For the purpose of `top_earlgrey`, the first option has been chosen to benefit s
| otp_ctrl | otp_ctrl | 0x40130000 (core) |
| | | 0x40138000 (prim) |
| lc_ctrl | lc_ctrl | 0x40140000 (regs) |
| | | 0 (dmi) |
Copy link
Contributor

Choose a reason for hiding this comment

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

It clearly doesn't matter, but maybe worth getting the "(dmi)" bit to line up with the other items? Maybe by expressing the address as 0x00000000?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the address to 0x00000000 but it will stick there with the lcctrl.

andreaskurth and others added 4 commits October 22, 2024 15:47
The TL-UL-based DMI is accessible through ports of `top_darjeeling`.

Opens:
- Pinmux has not been touched; in its instantiation in Darjeeling the
  JTAG output port to `lc_ctrl` is left unconnected and the
  corresponding input port is tied off.
- `lc_ctrl`'s block-level DV has not been updated yet.
- Darjeeling's testbench and UVM environment have not been updated
  yet.
- Darjeeling's Verilator top has not been updated yet.
- Darjeeling's FPGA top has not been updated yet.

Co-authored-by: Michael Schaffner <msf@opentitan.org>

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
In preparation for converting DMI to be TL-UL, making use of common xbar
infrastructure, and adding a separate reg block for DMI to connect to,
give the usual lc_ctrl reg block a name.

Co-authored-by: Michael Schaffner <msf@opentitan.org>
Co-authored-by: Alexander Williams <awill@opentitan.org>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Co-authored-by: Michael Schaffner <msf@opentitan.org>
Co-authored-by: Alexander Williams <awill@opentitan.org>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants