Skip to content

Commit

Permalink
Bump register interface to v0.3.1 (openhwgroup#819)
Browse files Browse the repository at this point in the history
* Bump register interface to v0.3.1

* Upgrade PLIC to upgraded register interface version v0.3.1

* Upgrade rv_plic submodule

* Add rv_plic upgrade to xilinx target. Fix indentations

* Try again (indentation)

* Add register_interface include
  • Loading branch information
andreaskuster authored Feb 10, 2022
1 parent 1e23eba commit c72a9e5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 34 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ ariane_pkg += core/include/riscv_pkg.sv \
core/include/cvxif_pkg.sv \
corev_apu/axi/src/axi_pkg.sv \
corev_apu/register_interface/src/reg_intf.sv \
corev_apu/register_interface/src/reg_intf_pkg.sv \
core/include/axi_intf.sv \
corev_apu/tb/rvfi_pkg.sv \
corev_apu/tb/ariane_soc_pkg.sv \
corev_apu/tb/ariane_axi_soc_pkg.sv \
core/include/ariane_axi_pkg.sv \
core/fpu/src/fpnew_pkg.sv \
common/submodules/common_cells/src/cf_math_pkg.sv \
core/cvxif_example/include/cvxif_instr_pkg.sv \
core/fpu/src/fpu_div_sqrt_mvp/hdl/defs_div_sqrt_mvp.sv
ariane_pkg := $(addprefix $(root-dir), $(ariane_pkg))
Expand Down Expand Up @@ -187,7 +187,6 @@ src := $(filter-out core/ariane_regfile.sv, $(wildcard core/*.sv))
corev_apu/riscv-dbg/debug_rom/debug_rom.sv \
corev_apu/register_interface/src/apb_to_reg.sv \
corev_apu/axi/src/axi_multicut.sv \
common/submodules/common_cells/src/cf_math_pkg.sv \
common/submodules/common_cells/src/deprecated/generic_fifo.sv \
common/submodules/common_cells/src/deprecated/pulp_sync.sv \
common/submodules/common_cells/src/deprecated/find_first_one.sv \
Expand Down Expand Up @@ -281,7 +280,7 @@ riscv-fp-tests := $(shell xargs printf '\n%s' < $(riscv-fp-tests-list
riscv-benchmarks := $(shell xargs printf '\n%s' < $(riscv-benchmarks-list) | cut -b 1-)

# Search here for include files (e.g.: non-standalone components)
incdir := common/submodules/common_cells/include/ corev_apu/axi/include/
incdir := common/submodules/common_cells/include/ corev_apu/axi/include/ corev_apu/register_interface/include/

# Compile and sim flags
compile_flag += +cover=bcfst+/dut -incr -64 -nologo -quiet -suppress 13262 -permissive +define+$(defines)
Expand Down
2 changes: 1 addition & 1 deletion corev_apu/fpga/scripts/run.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ read_ip { \
}
# read_ip xilinx/xlnx_protocol_checker/ip/xlnx_protocol_checker.xci

set_property include_dirs { "src/axi_sd_bridge/include" "../../common/submodules/common_cells/include" "../axi/include"} [current_fileset]
set_property include_dirs { "src/axi_sd_bridge/include" "../../common/submodules/common_cells/include" "../axi/include" "../register_interface/include"} [current_fileset]

source scripts/add_sources.tcl

Expand Down
29 changes: 15 additions & 14 deletions corev_apu/fpga/src/ariane_peripherals_xilinx.sv
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

// Xilinx Peripehrals
// Xilinx Peripherals

`include "register_interface/assign.svh"
`include "register_interface/typedef.svh"

module ariane_peripherals #(
parameter int AxiAddrWidth = -1,
Expand Down Expand Up @@ -160,28 +163,26 @@ module ariane_peripherals #(
.reg_o ( reg_bus )
);

reg_intf::reg_intf_resp_d32 plic_resp;
reg_intf::reg_intf_req_a32_d32 plic_req;

assign plic_req.addr = reg_bus.addr;
assign plic_req.write = reg_bus.write;
assign plic_req.wdata = reg_bus.wdata;
assign plic_req.wstrb = reg_bus.wstrb;
assign plic_req.valid = reg_bus.valid;
// define reg type according to REG_BUS above
`REG_BUS_TYPEDEF_ALL(plic, logic[31:0], logic[31:0], logic[3:0])
plic_req_t plic_req;
plic_rsp_t plic_rsp;

assign reg_bus.rdata = plic_resp.rdata;
assign reg_bus.error = plic_resp.error;
assign reg_bus.ready = plic_resp.ready;
// assign REG_BUS.out to (req_t, rsp_t) pair
`REG_BUS_ASSIGN_TO_REQ(plic_req, reg_bus)
`REG_BUS_ASSIGN_FROM_RSP(reg_bus, plic_rsp)

plic_top #(
.N_SOURCE ( ariane_soc::NumSources ),
.N_TARGET ( ariane_soc::NumTargets ),
.MAX_PRIO ( ariane_soc::MaxPriority )
.MAX_PRIO ( ariane_soc::MaxPriority ),
.reg_req_t ( plic_req_t ),
.reg_rsp_t ( plic_rsp_t )
) i_plic (
.clk_i,
.rst_ni,
.req_i ( plic_req ),
.resp_o ( plic_resp ),
.resp_o ( plic_rsp ),
.le_i ( '0 ), // 0:level 1:edge
.irq_sources_i ( irq_sources ),
.eip_targets_o ( irq_o )
Expand Down
2 changes: 1 addition & 1 deletion corev_apu/register_interface
Submodule register_interface updated 88 files
+16 −0 .github/verible-lint-matcher.json
+58 −0 .github/workflows/lint.yml
+2 −0 .gitignore
+20 −4 Bender.yml
+37 −2 CHANGELOG.md
+176 −0 LICENSE
+11 −1 README.md
+46 −0 include/register_interface/assign.svh
+38 −0 include/register_interface/typedef.svh
+6 −0 ips_list.yml
+10 −0 lint/verible.waiver
+112 −32 src/axi_lite_to_reg.sv
+109 −4 src/axi_to_reg.sv
+105 −0 src/periph_to_reg.sv
+177 −0 src/reg_cdc.sv
+37 −0 src/reg_demux.sv
+0 −56 src/reg_intf_pkg.sv
+71 −0 src/reg_mux.sv
+58 −0 src/reg_to_mem.sv
+11 −11 src/reg_uniform.sv
+49 −0 src_files.yml
+774 −0 util/vendor.py
+14 −0 vendor/lowrisc_opentitan.lock.hjson
+25 −0 vendor/lowrisc_opentitan.vendor.hjson
+64 −0 vendor/lowrisc_opentitan/src/prim_subreg.sv
+79 −0 vendor/lowrisc_opentitan/src/prim_subreg_arb.sv
+28 −0 vendor/lowrisc_opentitan/src/prim_subreg_ext.sv
+157 −0 vendor/lowrisc_opentitan/src/prim_subreg_shadow.sv
+113 −0 vendor/lowrisc_opentitan/util/reggen/README.md
+0 −0 vendor/lowrisc_opentitan/util/reggen/__init__.py
+121 −0 vendor/lowrisc_opentitan/util/reggen/access.py
+54 −0 vendor/lowrisc_opentitan/util/reggen/alert.py
+87 −0 vendor/lowrisc_opentitan/util/reggen/bits.py
+187 −0 vendor/lowrisc_opentitan/util/reggen/bus_interfaces.py
+35 −0 vendor/lowrisc_opentitan/util/reggen/enum_entry.py
+291 −0 vendor/lowrisc_opentitan/util/reggen/field.py
+177 −0 vendor/lowrisc_opentitan/util/reggen/fpv_csr.sv.tpl
+113 −0 vendor/lowrisc_opentitan/util/reggen/gen_cfg_html.py
+439 −0 vendor/lowrisc_opentitan/util/reggen/gen_cheader.py
+108 −0 vendor/lowrisc_opentitan/util/reggen/gen_dv.py
+81 −0 vendor/lowrisc_opentitan/util/reggen/gen_fpv.py
+325 −0 vendor/lowrisc_opentitan/util/reggen/gen_html.py
+34 −0 vendor/lowrisc_opentitan/util/reggen/gen_json.py
+136 −0 vendor/lowrisc_opentitan/util/reggen/gen_rtl.py
+306 −0 vendor/lowrisc_opentitan/util/reggen/gen_selfdoc.py
+83 −0 vendor/lowrisc_opentitan/util/reggen/html_helpers.py
+81 −0 vendor/lowrisc_opentitan/util/reggen/inter_signal.py
+365 −0 vendor/lowrisc_opentitan/util/reggen/ip_block.py
+262 −0 vendor/lowrisc_opentitan/util/reggen/lib.py
+142 −0 vendor/lowrisc_opentitan/util/reggen/multi_register.py
+341 −0 vendor/lowrisc_opentitan/util/reggen/params.py
+45 −0 vendor/lowrisc_opentitan/util/reggen/reg_base.py
+431 −0 vendor/lowrisc_opentitan/util/reggen/reg_block.py
+74 −0 vendor/lowrisc_opentitan/util/reggen/reg_html.css
+347 −0 vendor/lowrisc_opentitan/util/reggen/reg_pkg.sv.tpl
+712 −0 vendor/lowrisc_opentitan/util/reggen/reg_top.sv.tpl
+375 −0 vendor/lowrisc_opentitan/util/reggen/register.py
+63 −0 vendor/lowrisc_opentitan/util/reggen/signal.py
+14 −0 vendor/lowrisc_opentitan/util/reggen/uvm_reg.sv.tpl
+431 −0 vendor/lowrisc_opentitan/util/reggen/uvm_reg_base.sv.tpl
+155 −0 vendor/lowrisc_opentitan/util/reggen/validate.py
+24 −0 vendor/lowrisc_opentitan/util/reggen/version.py
+169 −0 vendor/lowrisc_opentitan/util/reggen/window.py
+235 −0 vendor/lowrisc_opentitan/util/regtool.py
+8 −0 vendor/lowrisc_opentitan/util/topgen/__init__.py
+444 −0 vendor/lowrisc_opentitan/util/topgen/c.py
+46 −0 vendor/lowrisc_opentitan/util/topgen/gen_dv.py
+1,005 −0 vendor/lowrisc_opentitan/util/topgen/intermodule.py
+497 −0 vendor/lowrisc_opentitan/util/topgen/lib.py
+1,081 −0 vendor/lowrisc_opentitan/util/topgen/merge.py
+4 −0 vendor/lowrisc_opentitan/util/topgen/templates/README.md
+17 −0 vendor/lowrisc_opentitan/util/topgen/templates/chip_env_pkg__params.sv.tpl
+1,218 −0 vendor/lowrisc_opentitan/util/topgen/templates/chiplevel.sv.tpl
+4 −0 vendor/lowrisc_opentitan/util/topgen/templates/clang-format
+21 −0 vendor/lowrisc_opentitan/util/topgen/templates/tb__alert_handler_connect.sv.tpl
+124 −0 vendor/lowrisc_opentitan/util/topgen/templates/tb__xbar_connect.sv.tpl
+21 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel.c.tpl
+201 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel.h.tpl
+832 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel.sv.tpl
+62 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel_memory.h.tpl
+30 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel_memory.ld.tpl
+112 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel_pkg.sv.tpl
+44 −0 vendor/lowrisc_opentitan/util/topgen/templates/toplevel_rnd_cnst_pkg.sv.tpl
+88 −0 vendor/lowrisc_opentitan/util/topgen/templates/xbar_env_pkg__params.sv.tpl
+122 −0 vendor/lowrisc_opentitan/util/topgen/top.py
+151 −0 vendor/lowrisc_opentitan/util/topgen/top_uvm_reg.sv.tpl
+878 −0 vendor/lowrisc_opentitan/util/topgen/validate.py
+386 −0 vendor/patches/lowrisc_opentitan/0001-Add-reg_interface-support.patch
2 changes: 1 addition & 1 deletion corev_apu/rv_plic
29 changes: 15 additions & 14 deletions corev_apu/tb/ariane_peripherals.sv
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

// Xilinx Peripehrals
`include "register_interface/assign.svh"
`include "register_interface/typedef.svh"

// Xilinx Peripherals
module ariane_peripherals #(
parameter int AxiAddrWidth = -1,
parameter int AxiDataWidth = -1,
Expand Down Expand Up @@ -153,28 +156,26 @@ module ariane_peripherals #(
.reg_o ( reg_bus )
);

reg_intf::reg_intf_resp_d32 plic_resp;
reg_intf::reg_intf_req_a32_d32 plic_req;

assign plic_req.addr = reg_bus.addr;
assign plic_req.write = reg_bus.write;
assign plic_req.wdata = reg_bus.wdata;
assign plic_req.wstrb = reg_bus.wstrb;
assign plic_req.valid = reg_bus.valid;
// define reg type according to REG_BUS above
`REG_BUS_TYPEDEF_ALL(plic, logic[31:0], logic[31:0], logic[3:0])
plic_req_t plic_req;
plic_rsp_t plic_rsp;

assign reg_bus.rdata = plic_resp.rdata;
assign reg_bus.error = plic_resp.error;
assign reg_bus.ready = plic_resp.ready;
// assign REG_BUS.out to (req_t, rsp_t) pair
`REG_BUS_ASSIGN_TO_REQ(plic_req, reg_bus)
`REG_BUS_ASSIGN_FROM_RSP(reg_bus, plic_rsp)

plic_top #(
.N_SOURCE ( ariane_soc::NumSources ),
.N_TARGET ( ariane_soc::NumTargets ),
.MAX_PRIO ( ariane_soc::MaxPriority )
.MAX_PRIO ( ariane_soc::MaxPriority ),
.reg_req_t ( plic_req_t ),
.reg_rsp_t ( plic_rsp_t )
) i_plic (
.clk_i,
.rst_ni,
.req_i ( plic_req ),
.resp_o ( plic_resp ),
.resp_o ( plic_rsp ),
.le_i ( '0 ), // 0:level 1:edge
.irq_sources_i ( irq_sources ),
.eip_targets_o ( irq_o )
Expand Down

0 comments on commit c72a9e5

Please sign in to comment.