Skip to content

Commit

Permalink
[ipgen] Try out a virtual provider library for 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 085b35f
Show file tree
Hide file tree
Showing 82 changed files with 370 additions and 265 deletions.
5 changes: 5 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,9 @@ filesets:
- ${instance_vlnv("lowrisc:ip:alert_handler_component:0.1")}
- ${instance_vlnv("lowrisc:ip_interfaces:alert_handler_reg:0.1")}
file_type: systemVerilogSource
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:alert_handler_virtual_provider")})"

parameters:
SYNTHESIS:
Expand All @@ -28,6 +31,8 @@ targets:

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand Down
5 changes: 5 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,10 @@ filesets:
- ${instance_vlnv("lowrisc:dv:alert_handler_sva:0.1")}
file_type: systemVerilogSource

files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:alert_handler_virtual_provider")})"

generate:
ral:
generator: ralgen
Expand All @@ -31,6 +35,7 @@ targets:
filesets:
- files_rtl
- files_dv
- files_virtual_provider
generate:
- ral
default_tool: vcs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ filesets:
- tb/alert_handler_esc_timer_bind_fpv.sv
- tb/alert_handler_esc_timer_tb.sv
file_type: systemVerilogSource
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:alert_handler_virtual_provider")})"

targets:
default: &default_target
Expand All @@ -26,6 +29,10 @@ targets:

formal:
<<: *default_target
filesets_append:
- files_virtual_provider

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ filesets:
- tb/alert_handler_ping_timer_bind_fpv.sv
- tb/alert_handler_ping_timer_tb.sv
file_type: systemVerilogSource
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:alert_handler_virtual_provider")})"

targets:
default: &default_target
Expand All @@ -26,6 +29,10 @@ targets:

formal:
<<: *default_target
filesets_append:
- files_virtual_provider

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
10 changes: 3 additions & 7 deletions hw/ip_templates/clkmgr/clkmgr.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ filesets:
- rtl/clkmgr_trans.sv
file_type: systemVerilogSource

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

files_verilator_waiver:
depend:
Expand Down Expand Up @@ -69,10 +67,8 @@ targets:

lint:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
filesets_append:
- files_top_lint
% endif
- files_virtual_provider
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand Down
6 changes: 0 additions & 6 deletions hw/ip_templates/clkmgr/data/clkmgr.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,5 @@
type: "bool"
default: "1"
}
{
name: "pwrmgr_instance_name"
desc: "Instance name for the pwrmgr dependencies, if available"
type: "string"
default: ""
}
]
}
10 changes: 3 additions & 7 deletions hw/ip_templates/clkmgr/dv/clkmgr_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@ filesets:
- cov/clkmgr_cov_bind.sv
file_type: systemVerilogSource

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

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

lint:
Expand Down
6 changes: 0 additions & 6 deletions hw/ip_templates/flash_ctrl/data/flash_ctrl.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,5 @@
type: "int"
default: "1048576"
}
{
name: "pwrmgr_instance_name"
desc: "Instance name for the pwrmgr dependencies, if available"
type: "string"
default: ""
}
]
}
14 changes: 4 additions & 10 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,9 @@ filesets:
- tb/tb.sv
file_type: systemVerilogSource

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

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

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

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

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

files_verilator_waiver:
depend:
Expand Down Expand Up @@ -93,10 +91,8 @@ targets:

lint:
<<: *default_target
% if len(pwrmgr_instance_name) > 0:
filesets_append:
- files_top_lint
% endif
- files_virtual_provider
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand Down
7 changes: 7 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,9 @@ filesets:
files:
- tb/pinmux_chip_tb.sv
file_type: systemVerilogSource
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pinmux_virtual_provider")})"

generate:
csr_assert_gen:
Expand All @@ -38,6 +41,10 @@ targets:

formal:
<<: *default_target
filesets_append:
- files_virtual_provider

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
7 changes: 7 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,9 @@ filesets:
files:
- tb/pinmux_tb.sv
file_type: systemVerilogSource
files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pinmux_virtual_provider")})"

generate:
csr_assert_gen:
Expand All @@ -34,6 +37,10 @@ targets:

formal:
<<: *default_target
filesets_append:
- files_virtual_provider

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
7 changes: 7 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,10 @@ filesets:
- rtl/pinmux.sv
file_type: systemVerilogSource

files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pinmux_virtual_provider")})"

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

lint:
<<: *default_target
filesets_append:
- files_virtual_provider
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand All @@ -95,4 +101,5 @@ targets:
formal:
filesets:
- files_rtl
- files_virtual_provider
toplevel: pinmux_tb
12 changes: 0 additions & 12 deletions hw/ip_templates/pwrmgr/data/pwrmgr.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,5 @@
type: "int"
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"
type: "string"
default: ""
}
]
}
19 changes: 3 additions & 16 deletions hw/ip_templates/pwrmgr/dv/pwrmgr_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,17 @@ 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:
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
% endif
- "fileset_top ? (${instance_vlnv("lowrisc:ip:pwrmgr_virtual_provider")})"

targets:
sim: &sim_target
toplevel: tb
filesets:
- files_rtl
- files_dv
% if have_files_top_sim:
- files_top_sim
% endif
- files_virtual_provider
default_tool: vcs

lint:
Expand Down
10 changes: 3 additions & 7 deletions hw/ip_templates/pwrmgr/pwrmgr.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ filesets:
- ${instance_vlnv("lowrisc:ip:pwrmgr_component:0.1")}
file_type: systemVerilogSource

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

files_verilator_waiver:
depend:
Expand Down Expand Up @@ -62,10 +60,8 @@ targets:

lint:
<<: *default_target
% if len(alert_handler_instance_name) > 0:
filesets_append:
- files_top_lint
% endif
- files_virtual_provider
default_tool: verilator
parameters:
- SYNTHESIS=true
Expand Down
12 changes: 0 additions & 12 deletions hw/ip_templates/rstmgr/data/rstmgr.tpldesc.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,5 @@
type: "bool"
default: "1"
}
{
name: "alert_handler_instance_name"
desc: "Instance name for the alert_handler dependencies, if available"
type: "string"
default: ""
}
{
name: "pwrmgr_instance_name"
desc: "Instance name for the pwrmgr dependencies, if available"
type: "string"
default: ""
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ filesets:
- tb.sv
file_type: systemVerilogSource

files_virtual_provider:
depend:
- "fileset_top ? (${instance_vlnv("lowrisc:ip:rstmgr_virtual_provider")})"

targets:
sim: &sim_target
toplevel: tb
filesets:
- files_rtl
- files_dv
- files_virtual_provider
default_tool: vcs

lint:
Expand Down
Loading

0 comments on commit 085b35f

Please sign in to comment.