[prim] Split out arbiters into a prim_arbiter core

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/prim/lint/prim.waiver b/hw/ip/prim/lint/prim.waiver
index 1e887a9..b42d921 100644
--- a/hw/ip/prim/lint/prim.waiver
+++ b/hw/ip/prim/lint/prim.waiver
@@ -29,16 +29,6 @@
 waive -rules INPUT_NOT_READ       -location {prim_subreg.sv} -regexp {Input port 'wd' is not read from} \
       -comment "for RO wd is not used"
 
-# primitives: prim_arbiter_*
-waive -rules PARTIAL_CONST_ASSIGN -location {prim_arbiter_*.sv} -regexp {'mask.0.' is conditionally assigned a constant} \
-      -comment "makes the code more readable"
-waive -rules CONST_FF -location {prim_arbiter_*.sv} -regexp {Flip-flop 'mask.0.' is driven by constant} \
-      -comment "makes the code more readable"
-
-# primitives: prim_sram_arbiter
-waive -rules CONST_OUTPUT -location {prim_sram_arbiter.sv} -regexp {rsp_error.* is driven by constant} \
-      -comment "SRAM protection is not yet implemented"
-
 # primitives: prim_fifos
 
 waive -rules VAR_INDEX_RANGE      -location {prim_fifo_*sync.sv} -regexp {maximum value .* may be too large for 'storage'} \
@@ -60,10 +50,6 @@
 #waive -rules NOT_READ -location {prim_ram_*_wrapper*} -regexp {(a|b)_rdata_(q|d)\[38} \
 #      -comment "Syndrome is not going out to the interface"
 
-# prim_arbiter_fixed
-waive -rules {HIER_BRANCH_NOT_READ INPUT_NOT_READ} -location {prim_arbiter_fixed.sv} -regexp {.*'(clk_i|rst_ni)' is not read from in module 'prim_arbiter_fixed'.*} \
-      -comment "clk_ and rst_ni are only used for assertions in this module."
-
 waive -rules {INTEGER} -location {prim_cipher_pkg.sv} -msg {'k' of type int used as a non-constant} \
       -comment "We need to use the iterator value in the keyschedule function, hence this is ok."
 
diff --git a/hw/ip/prim/lint/prim_arbiter.waiver b/hw/ip/prim/lint/prim_arbiter.waiver
new file mode 100644
index 0000000..f1bf4c2
--- /dev/null
+++ b/hw/ip/prim/lint/prim_arbiter.waiver
@@ -0,0 +1,16 @@
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+#
+# waiver file for prim_arbiter
+
+waive -rules PARTIAL_CONST_ASSIGN -location {prim_arbiter_*.sv} -regexp {'mask.0.' is conditionally assigned a constant} \
+      -comment "makes the code more readable"
+waive -rules CONST_FF -location {prim_arbiter_*.sv} -regexp {Flip-flop 'mask.0.' is driven by constant} \
+      -comment "makes the code more readable"
+
+waive -rules CONST_OUTPUT -location {prim_sram_arbiter.sv} -regexp {rsp_error.* is driven by constant} \
+      -comment "SRAM protection is not yet implemented"
+
+waive -rules {HIER_BRANCH_NOT_READ INPUT_NOT_READ} -location {prim_arbiter_fixed.sv} -regexp {.*'(clk_i|rst_ni)' is not read from in module 'prim_arbiter_fixed'.*} \
+      -comment "clk_ and rst_ni are only used for assertions in this module."
diff --git a/hw/ip/prim/prim.core b/hw/ip/prim/prim.core
index 1d145a6..d700341 100644
--- a/hw/ip/prim/prim.core
+++ b/hw/ip/prim/prim.core
@@ -19,14 +19,12 @@
       - lowrisc:prim:flop
       - lowrisc:prim:flop_2sync
       - lowrisc:prim:cipher_pkg:0.1
+      - lowrisc:prim:arbiter
     files:
       - rtl/prim_clock_gating_sync.sv
       - rtl/prim_alert_pkg.sv
       - rtl/prim_alert_receiver.sv
       - rtl/prim_alert_sender.sv
-      - rtl/prim_arbiter_ppc.sv
-      - rtl/prim_arbiter_tree.sv
-      - rtl/prim_arbiter_fixed.sv
       - rtl/prim_esc_pkg.sv
       - rtl/prim_esc_receiver.sv
       - rtl/prim_esc_sender.sv
diff --git a/hw/ip/prim/prim_arbiter.core b/hw/ip/prim/prim_arbiter.core
new file mode 100644
index 0000000..18c6d3b
--- /dev/null
+++ b/hw/ip/prim/prim_arbiter.core
@@ -0,0 +1,42 @@
+CAPI=2:
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+
+name: "lowrisc:prim:arbiter"
+description: "Generic arbiter"
+filesets:
+  files_rtl:
+    depend:
+      - lowrisc:prim:assert
+    files:
+      - rtl/prim_arbiter_ppc.sv
+      - rtl/prim_arbiter_tree.sv
+      - rtl/prim_arbiter_fixed.sv
+    file_type: systemVerilogSource
+
+  files_verilator_waiver:
+    depend:
+      # common waivers
+      - lowrisc:lint:common
+
+  files_ascentlint_waiver:
+    depend:
+      # common waivers
+      - lowrisc:lint:common
+    files:
+      - lint/prim_arbiter.waiver
+    file_type: waiver
+
+  files_veriblelint_waiver:
+    depend:
+      # common waivers
+      - lowrisc:lint:common
+
+targets:
+  default:
+    filesets:
+      - tool_verilator   ? (files_verilator_waiver)
+      - tool_ascentlint  ? (files_ascentlint_waiver)
+      - tool_veriblelint ? (files_veriblelint_waiver)
+      - files_rtl