Skip to content

Commit

Permalink
Fix minor unclear stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Mar 19, 2024
1 parent d63390d commit dc33fc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions carfield.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions hw/carfield.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ),
Expand Down Expand Up @@ -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 ),
Expand Down
12 changes: 4 additions & 8 deletions hw/carfield_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit dc33fc2

Please sign in to comment.