opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[util/topgen] Error handling: Absence of RV_PLIC Hjson

Open eunchan opened this issue 7 years ago • 6 comments

If rv_plic.hjson doesn't exist, the topgen will fail. The user shall manually generate rv_plic.hjson inside the top then run topgen.

Revise the topgen flow as below to solve this issue:

  1. Reads IPs and ignore rv_plic at first.
  2. Add interrupt to the top (up to amend_interrupt function in the merge_top function)
  3. Generate RV_PLIC
  4. Read RV_PLIC hjson object (returned value from generate_plic function) and add relative informations to the module list (rerun amend_ip for rv_plic only)
  5. continue the rest of the topgen code.

This is related to lowRISC/stwg-base#743 lowRISC/stwg-base#802

eunchan avatar Jul 23 '19 18:07 eunchan

@eunchan is this done?

sjgitty avatar Oct 25 '19 05:10 sjgitty

No. Still pending but we can punt it.

eunchan avatar Oct 25 '19 23:10 eunchan

This is a very old issue and it seems to be related to https://github.com/lowRISC/opentitan/pull/4944#pullrequestreview-575245310. @eunchan , do you want to check if this is done or still needed?

vogelpi avatar Jan 25 '21 10:01 vogelpi

Still need this IMO. Pirmin, do you see any error on secondary topgen? The secondary topgen does not have rv_plic.hjson at the beginning. I assume the topgen errors out , how did you solve?

eunchan avatar Jan 26 '21 22:01 eunchan

I think the following code section in topgen.py solves this issue: https://github.com/lowRISC/opentitan/blob/650bd0434abb173a568126f5e04a27685543f181/util/topgen.py#L1019-L1029

Basically, if the rv_plic.hjson in hw/{top_name}/ip/rv_plic is not available for the initial validation (this is the case for the secondary top levels), we use the one from hw/ip/rv_plic. The newly generated rv_plic.hjson is then validated again inside generate_plic().

vogelpi avatar Jan 27 '21 07:01 vogelpi

Ah.. thanks for pointing out Pirmin.

Then, we can close. :)

On Jan 26, 2021, at 11:40 PM, Pirmin Vogel [email protected] wrote:

I think the following code section in topgen.py solves this issue: https://github.com/lowRISC/opentitan/blob/650bd0434abb173a568126f5e04a27685543f181/util/topgen.py#L1019-L1029 https://github.com/lowRISC/opentitan/blob/650bd0434abb173a568126f5e04a27685543f181/util/topgen.py#L1019-L1029 Basically, if the rv_plic.hjson in hw/{top_name}/ip/rv_plic is not available for the initial validation (this is the case for the secondary top levels), we use the one from hw/ip/rv_plic. The newly generated rv_plic.hjson is then validated again inside generate_plic().

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/28#issuecomment-768098665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJDG3SYJ26G3EMRCJGT2SDS367NTANCNFSM4ISTJR5A.

eunchan avatar Jan 27 '21 17:01 eunchan