diff --git a/carfield.mk b/carfield.mk index 4ec2e825..a150a6ad 100644 --- a/carfield.mk +++ b/carfield.mk @@ -23,7 +23,7 @@ CAR_SW_DIR := $(CAR_ROOT)/sw CAR_TGT_DIR := $(CAR_ROOT)/target/ CAR_XIL_DIR := $(CAR_TGT_DIR)/xilinx CAR_SIM_DIR := $(CAR_TGT_DIR)/sim -SECD_ROOT ?= $(shell $(BENDER) path opentitan) +SECD_ROOT ?= $(shell $(BENDER) path opentitan) # Questasim CAR_VSIM_DIR := $(CAR_TGT_DIR)/sim/vsim @@ -216,7 +216,7 @@ pulpd-sw-build: pulpd-sw-init ## for more information. car-hw-init: spatzd-hw-init chs-hw-init secd-hw-init -#Build OpenTitan's debug rom with support for coreid=0x4 +#Build OpenTitan's debug rom with support for coreid != 0x0 secd-hw-init: $(MAKE) -C $(SECD_ROOT)/hw/vendor/pulp_riscv_dbg/debug_rom clean all FLAGS=-DCARFIELD=1 diff --git a/hw/carfield.sv b/hw/carfield.sv index e1920672..ce9094cb 100644 --- a/hw/carfield.sv +++ b/hw/carfield.sv @@ -1760,7 +1760,7 @@ if (CarfieldIslandsCfg.secured.enable) begin : gen_secure_subsystem assign security_island_isolate_req = car_regs_reg2hw.security_island_isolate.q && !secure_boot_i; assign car_regs_hw2reg.security_island_isolate_status.d = - master_isolated_rsp[SecurityIslandTlulMstIdx]; + master_isolated_rsp[SecurityIslandTlulMstIdx] & master_isolated_rsp[SecurityIslandiDMAMstIdx]; assign car_regs_hw2reg.security_island_isolate_status.de = 1'b1; typedef logic [Cfg.AddrWidth-1:0] narrow_axi_addr_t; @@ -1774,7 +1774,7 @@ if (CarfieldIslandsCfg.secured.enable) begin : gen_secure_subsystem `ifndef SECD_NETLIST secure_subsystem_synth_wrap_astral #( - .HartIdOffs ( 4 ), + .HartIdOffs ( OpnTitHartIdOffs ), .AxiAddrWidth ( Cfg.AddrWidth ), .AxiDataWidth ( Cfg.AxiDataWidth ), .AxiUserWidth ( Cfg.AxiUserWidth ), @@ -1855,8 +1855,8 @@ if (CarfieldIslandsCfg.secured.enable) begin : gen_secure_subsystem .async_idma_axi_out_r_data_i ( axi_mst_ext_r_data [SecurityIslandiDMAMstIdx] ), .async_idma_axi_out_r_wptr_i ( axi_mst_ext_r_wptr [SecurityIslandiDMAMstIdx] ), .async_idma_axi_out_r_rptr_o ( axi_mst_ext_r_rptr [SecurityIslandiDMAMstIdx] ), - .axi_isolate_i ( {'0, security_island_isolate_req } ), - .axi_isolated_o ( { unused, master_isolated_rsp[SecurityIslandTlulMstIdx] } ), + .axi_isolate_i ( security_island_isolate_req ), + .axi_isolated_o ( { master_isolated_rsp[SecurityIslandiDMAMstIdx] master_isolated_rsp[SecurityIslandTlulMstIdx] } ), // Uart .ibex_uart_rx_i ( uart_ot_rx_i ), .ibex_uart_tx_o ( uart_ot_tx_o ), diff --git a/hw/carfield_pkg.sv b/hw/carfield_pkg.sv index 8753576a..1419a495 100644 --- a/hw/carfield_pkg.sv +++ b/hw/carfield_pkg.sv @@ -41,7 +41,6 @@ typedef struct packed { islands_properties_t pulp; islands_properties_t secured; islands_properties_t mbox; - islands_properties_t secured_idma; } islands_cfg_t; // Types are obtained from Cheshire package @@ -126,8 +125,7 @@ function automatic int unsigned gen_num_axi_master(islands_cfg_t island_cfg); if (island_cfg.safed.enable ) begin ret++; end if (island_cfg.spatz.enable ) begin ret++; end if (island_cfg.pulp.enable ) begin ret++; end - if (island_cfg.secured.enable) begin ret++; end - if (island_cfg.secured.enable) begin ret++; end + if (island_cfg.secured.enable) begin ret+=2; end return ret; endfunction @@ -139,12 +137,10 @@ function automatic carfield_master_idx_t carfield_gen_axi_master_idx(islands_cfg byte_bt j = 0; if (island_cfg.safed.enable) begin ret.safed = i; i++; end else begin ret.safed = MaxExtAxiMst + j; j++; end - if (island_cfg.secured.enable) begin ret.secured = i; i++; - end else begin ret.secured = MaxExtAxiMst + j; j++; end + if (island_cfg.secured.enable) begin ret.secured = i; ret.secured_idma = i+1; i+=2; + end else begin ret.secured = MaxExtAxiMst + j; ret.secured_idma = MaxExtAxiMst + j + 1; j+=2; end if (island_cfg.spatz.enable) begin ret.spatz = i; i++; end else begin ret.spatz = MaxExtAxiMst + j; j++; end - if (island_cfg.secured.enable) begin ret.secured_idma = i; i++; - end else begin ret.secured_idma = MaxExtAxiMst + j; j++; end if (island_cfg.pulp.enable) begin ret.pulp = i; i++; end else begin ret.pulp = MaxExtAxiMst + j; j++; end return ret; @@ -424,8 +420,8 @@ typedef enum byte_bt { typedef enum byte_bt { SafetyIslandMstIdx = CarfieldMstIdx.safed, SecurityIslandTlulMstIdx = CarfieldMstIdx.secured, - FPClusterMstIdx = CarfieldMstIdx.spatz, SecurityIslandiDMAMstIdx = CarfieldMstIdx.secured_idma, + FPClusterMstIdx = CarfieldMstIdx.spatz, IntClusterMstIdx = CarfieldMstIdx.pulp } axi_mst_idx_t;