[prim] Stub out guts of prim_cdc_rand_delay for Verilator
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/prim/lint/prim_cdc_rand_delay.vlt b/hw/ip/prim/lint/prim_cdc_rand_delay.vlt
new file mode 100644
index 0000000..6416525
--- /dev/null
+++ b/hw/ip/prim/lint/prim_cdc_rand_delay.vlt
@@ -0,0 +1,10 @@
+// Copyright lowRISC contributors.
+// Licensed under the Apache License, Version 2.0, see LICENSE for details.
+// SPDX-License-Identifier: Apache-2.0
+
+`verilator_config
+
+// When running this prim through Verilator, we stub out all of its contents.
+// This, in turn, generates UNUSED warnings which we can waive here. No need to
+// be fine-grained: this is DV code anyway.
+lint_off -rule UNUSED -file "*/rtl/prim_cdc_rand_delay.sv" -match "*"
diff --git a/hw/ip/prim/prim_cdc_rand_delay.core b/hw/ip/prim/prim_cdc_rand_delay.core
index 8d1be6c..8217357 100644
--- a/hw/ip/prim/prim_cdc_rand_delay.core
+++ b/hw/ip/prim/prim_cdc_rand_delay.core
@@ -18,6 +18,7 @@
# common waivers
- lowrisc:lint:common
files:
+ - lint/prim_cdc_rand_delay.vlt
file_type: vlt
files_ascentlint_waiver:
@@ -35,6 +36,10 @@
targets:
default:
+ tools:
+ verilator:
+ verilator_options:
+ - '-DDISABLE_PRIM_CDC_RAND_DELAY'
filesets:
- files_rtl
- tool_verilator ? (files_verilator_waiver)