Skip to content

Commit

Permalink
[ipgen] Try out a single virtual provider library for all tops
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Williams <[email protected]>
  • Loading branch information
a-will committed Dec 29, 2024
1 parent ae6066e commit 4c542af
Show file tree
Hide file tree
Showing 83 changed files with 404 additions and 198 deletions.
9 changes: 9 additions & 0 deletions hw/ip_templates/alert_handler/alert_handler.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ filesets:
- ${instance_vlnv("lowrisc:ip:alert_handler_component:0.1")}
- ${instance_vlnv("lowrisc:ip_interfaces:alert_handler_reg:0.1")}
file_type: systemVerilogSource
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

parameters:
SYNTHESIS:
Expand All @@ -28,6 +33,10 @@ targets:

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@
type: "object"
default: []
}
{
name: "virtual_provider"
desc: "VLNV providing all virtual cores, used with fileset_top flag"
type: "string"
default: ""
}
]
}
9 changes: 9 additions & 0 deletions hw/ip_templates/alert_handler/dv/alert_handler_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ filesets:
- ${instance_vlnv("lowrisc:dv:alert_handler_sva:0.1")}
file_type: systemVerilogSource

% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

generate:
ral:
generator: ralgen
Expand All @@ -31,6 +37,9 @@ targets:
filesets:
- files_rtl
- files_dv
% if len(virtual_provider) > 0:
- files_virtual_provider
% endif
generate:
- ral
default_tool: vcs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ filesets:
- tb/alert_handler_esc_timer_bind_fpv.sv
- tb/alert_handler_esc_timer_tb.sv
file_type: systemVerilogSource
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

targets:
default: &default_target
Expand All @@ -26,6 +31,14 @@ targets:

formal:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ filesets:
- tb/alert_handler_ping_timer_bind_fpv.sv
- tb/alert_handler_ping_timer_tb.sv
file_type: systemVerilogSource
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "${virtual_provider}"
% endif

targets:
default: &default_target
Expand All @@ -26,6 +31,14 @@ targets:

formal:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
10 changes: 5 additions & 5 deletions hw/ip_templates/clkmgr/clkmgr.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ filesets:
- rtl/clkmgr_trans.sv
file_type: systemVerilogSource

% if len(pwrmgr_instance_name) > 0:
files_top_lint:
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1", pwrmgr_instance_name)})"
- "fileset_top ? (${virtual_provider})"
% endif

files_verilator_waiver:
Expand Down Expand Up @@ -69,9 +69,9 @@ targets:

lint:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
% if len(virtual_provider) > 0:
filesets_append:
- files_top_lint
- files_virtual_provider
% endif
default_tool: verilator
parameters:
Expand Down
4 changes: 2 additions & 2 deletions hw/ip_templates/clkmgr/data/clkmgr.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
default: "1"
}
{
name: "pwrmgr_instance_name"
desc: "Instance name for the pwrmgr dependencies, if available"
name: "virtual_provider"
desc: "VLNV providing all virtual cores, used with fileset_top flag"
type: "string"
default: ""
}
Expand Down
12 changes: 6 additions & 6 deletions hw/ip_templates/clkmgr/dv/clkmgr_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ filesets:
- cov/clkmgr_cov_bind.sv
file_type: systemVerilogSource

% if len(pwrmgr_instance_name) > 0:
files_top_sim:
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1", pwrmgr_instance_name)})"
%endif
- "fileset_top ? (${virtual_provider})"
% endif

targets:
sim: &sim_target
toplevel: tb
filesets:
- files_rtl
- files_dv
% if len(pwrmgr_instance_name) > 0:
- files_top_sim
% if len(virtual_provider) > 0:
- files_virtual_provider
% endif
default_tool: vcs

Expand Down
4 changes: 2 additions & 2 deletions hw/ip_templates/flash_ctrl/data/flash_ctrl.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
default: "1048576"
}
{
name: "pwrmgr_instance_name"
desc: "Instance name for the pwrmgr dependencies, if available"
name: "virtual_provider"
desc: "VLNV providing all virtual cores, used with fileset_top flag"
type: "string"
default: ""
}
Expand Down
16 changes: 8 additions & 8 deletions hw/ip_templates/flash_ctrl/dv/flash_ctrl_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ filesets:
- tb/tb.sv
file_type: systemVerilogSource

% if len(pwrmgr_instance_name) > 0:
files_top_sim:
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1", pwrmgr_instance_name)})"
%endif
- "fileset_top ? (${virtual_provider})"
% endif

targets:
default: &default_target
Expand All @@ -37,15 +37,15 @@ targets:

sim:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
% if len(virtual_provider) > 0:
filesets_append:
- files_top_sim
- files_virtual_provider
% endif
default_tool: vcs

lint:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
% if len(virtual_provider) > 0:
filesets_append:
- files_top_sim
- files_virtual_provider
% endif
10 changes: 5 additions & 5 deletions hw/ip_templates/flash_ctrl/flash_ctrl.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ filesets:
- rtl/flash_phy_scramble.sv
file_type: systemVerilogSource

% if len(pwrmgr_instance_name) > 0:
files_top_lint:
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1", pwrmgr_instance_name)})"
- "fileset_top ? (${virtual_provider})"
% endif

files_verilator_waiver:
Expand Down Expand Up @@ -93,9 +93,9 @@ targets:

lint:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
% if len(virtual_provider) > 0:
filesets_append:
- files_top_lint
- files_virtual_provider
% endif
default_tool: verilator
parameters:
Expand Down
6 changes: 6 additions & 0 deletions hw/ip_templates/pinmux/data/pinmux.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,11 @@
type: "bool"
default: "1"
}
{
name: "virtual_provider"
desc: "VLNV providing all virtual cores, used with fileset_top flag"
type: "string"
default: ""
}
]
}
13 changes: 13 additions & 0 deletions hw/ip_templates/pinmux/fpv/pinmux_chip_fpv.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ filesets:
files:
- tb/pinmux_chip_tb.sv
file_type: systemVerilogSource
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

generate:
csr_assert_gen:
Expand All @@ -38,6 +43,14 @@ targets:

formal:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
13 changes: 13 additions & 0 deletions hw/ip_templates/pinmux/fpv/pinmux_fpv.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ filesets:
files:
- tb/pinmux_tb.sv
file_type: systemVerilogSource
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

generate:
csr_assert_gen:
Expand All @@ -34,6 +39,14 @@ targets:

formal:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
13 changes: 13 additions & 0 deletions hw/ip_templates/pinmux/pinmux.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ filesets:
- rtl/pinmux.sv
file_type: systemVerilogSource

% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
- "fileset_top ? (${virtual_provider})"
% endif

files_verilator_waiver:
depend:
# common waivers
Expand Down Expand Up @@ -74,6 +80,10 @@ targets:

lint:
<<: *default_target
% if len(virtual_provider) > 0:
filesets_append:
- files_virtual_provider
% endif
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand All @@ -95,4 +105,7 @@ targets:
formal:
filesets:
- files_rtl
% if len(virtual_provider) > 0:
- files_virtual_provider
% endif
toplevel: pinmux_tb
10 changes: 2 additions & 8 deletions hw/ip_templates/pwrmgr/data/pwrmgr.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,8 @@
default: "1"
}
{
name: "alert_handler_instance_name"
desc: "Instance name for the alert_handler dependencies, if available"
type: "string"
default: ""
}
{
name: "clkmgr_instance_name"
desc: "Instance name for the clkmgr dependencies, if available"
name: "virtual_provider"
desc: "VLNV providing all virtual cores, used with fileset_top flag"
type: "string"
default: ""
}
Expand Down
19 changes: 5 additions & 14 deletions hw/ip_templates/pwrmgr/dv/pwrmgr_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,10 @@ filesets:
- tb.sv
- cov/pwrmgr_cov_bind.sv
file_type: systemVerilogSource
<%
have_files_top_sim = (len(clkmgr_instance_name) > 0 or
len(alert_handler_instance_name) > 0)
%>\
% if have_files_top_sim:
files_top_sim:
% if len(virtual_provider) > 0:
files_virtual_provider:
depend:
% if len(alert_handler_instance_name) > 0:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:alert_handler_pkg:0.1", alert_handler_instance_name)})"
% endif
% if len(clkmgr_instance_name) > 0:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:clkmgr_pwrmgr_sva_if:0.1", clkmgr_instance_name)})"
% endif
- "fileset_top ? (${virtual_provider})"
% endif

targets:
Expand All @@ -38,8 +29,8 @@ targets:
filesets:
- files_rtl
- files_dv
% if have_files_top_sim:
- files_top_sim
% if len(virtual_provider) > 0:
- files_virtual_provider
% endif
default_tool: vcs

Expand Down
Loading

0 comments on commit 4c542af

Please sign in to comment.