Skip to content

Commit

Permalink
Extend APB memory map.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella authored and Yvan Tortorella committed Jun 25, 2024
1 parent cb357a4 commit 1f5db55
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
22 changes: 11 additions & 11 deletions hw/configs/carfield_l2dual_safe_spatz_periph.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ localparam doub_bt EthernetSize = 'h00001000;
// Peripherals
localparam bit PeriphEnable = 1;
localparam doub_bt PeriphBase = 'h20001000;
localparam doub_bt PeriphSize = 'h00009000;
localparam doub_bt PeriphSize = 'h01000000;
// Spatz cluster
localparam bit SpatzClusterEnable = 1;
localparam doub_bt SpatzClusterBase = 'h51000000;
Expand Down Expand Up @@ -60,25 +60,25 @@ localparam doub_bt SystemAdvancedTimerSize = 'h00001000;
localparam doub_bt SystemWatchdogBase = 'h20007000;
localparam doub_bt SystemWatchdogSize = 'h00001000;
// Hyperbus Config
localparam doub_bt HyperBusBase = 'h20009000;
localparam doub_bt HyperBusBase = 'h20008000;
localparam doub_bt HyperBusSize = 'h00001000;
/************************
* RegBus Configuration *
***********************/
// Platform control registers
localparam doub_bt PcrsBase = 'h20010000;
localparam doub_bt PcrsSize = 'h00001000;
// PLL
localparam bit PllCfgEnable = 1;
localparam doub_bt PllCfgBase = 'h20020000;
localparam doub_bt PllCfgSize = 'h00001000;
// Padframe
localparam bit PadframeCfgEnable = 1;
localparam doub_bt PadframeCfgBase = 'h200A0000;
localparam doub_bt PadframeCfgBase = 'h21000000;
localparam doub_bt PadframeCfgSize = 'h00001000;
// L2 ECC
localparam bit L2EccCfgEnable = 1;
localparam doub_bt L2EccCfgBase = 'h200B0000;
localparam doub_bt L2EccCfgBase = 'h21001000;
localparam doub_bt L2EccCfgSize = 'h00001000;
// Platform control registers
localparam doub_bt PcrsBase = 'h21002000;
localparam doub_bt PcrsSize = 'h00001000;
// PLL
localparam bit PllCfgEnable = 1;
localparam doub_bt PllCfgBase = 'h21003000;
localparam doub_bt PllCfgSize = 'h00001000;

endpackage
17 changes: 8 additions & 9 deletions sw/include/car_memory_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ extern void *__base_l2;
// from carfield proper
#define CAR_PERIPHS_BASE_ADDR 0x20000000

#define CAR_ETHERNET_OFFSET 0x0000
#define CAR_CAN_OFFSET 0x1000
#define CAR_SYSTEM_TIMER_OFFSET 0x4000
#define CAR_ADVANCED_TIMER_OFFSET 0x5000
#define CAR_WATCHDOG_TIMER_OFFSET 0x7000
#define CAR_HYPERBUS_CFG_OFFSET 0x9000
#define CAR_PAD_CFG_OFFSET 0xa000
#define CAR_ETHERNET_OFFSET 0x0000000
#define CAR_CAN_OFFSET 0x0001000
#define CAR_SYSTEM_TIMER_OFFSET 0x0004000
#define CAR_ADVANCED_TIMER_OFFSET 0x0005000
#define CAR_WATCHDOG_TIMER_OFFSET 0x0007000
#define CAR_HYPERBUS_CFG_OFFSET 0x0008000
#define CAR_PAD_CFG_OFFSET 0x1000000

#define CAR_ETHERNET_BASE_ADDR (CAR_PERIPHS_BASE_ADDR + CAR_ETHERNET_OFFSET)
#define CAR_CAN_BASE_ADDR (CAR_PERIPHS_BASE_ADDR + CAR_CAN_OFFSET)
Expand Down Expand Up @@ -132,9 +132,8 @@ extern void *__base_l2;
#define MBOX_CAR_LETTER0(id) (CAR_MBOX_BASE_ADDR + MBOX_LETTER0_OFFSET + (id*0x100))
#define MBOX_CAR_LETTER1(id) (CAR_MBOX_BASE_ADDR + MBOX_LETTER1_OFFSET + (id*0x100))


// PLL
#define CAR_PLL_BASE_ADDRESS 0x20020000
#define CAR_PLL_BASE_ADDRESS 0x21003000
#define PLL_ADDR_SPACE 0x200
#define PLL_BASE_ADDRESS(id) (CAR_PLL_BASE_ADDRESS + (id+1)*PLL_ADDR_SPACE)

Expand Down
2 changes: 1 addition & 1 deletion sw/include/car_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#pragma once

#ifndef LINUX_APP // Hardcoded const pointers
const void* car_soc_ctrl = 0x20010000;
const void* car_soc_ctrl = 0x21002000;
const void* car_safety_island = 0x60000000;
const void* car_integer_cluster = 0x50000000;
const void* car_spatz_cluster = 0x51000000;
Expand Down
35 changes: 18 additions & 17 deletions target/sim/src/carfield_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module tb_carfield_soc;
import uvm_pkg::*;
import carfield_pkg::*;
import cheshire_pkg::*;
import carfield_configuration::*;

// carfield top
carfield_soc_fixture fix();
Expand All @@ -30,7 +31,7 @@ module tb_carfield_soc;
bit is_dram;

// hyperbus
localparam int unsigned HyperbusTburstMax = 32'h20009008;
localparam int unsigned HyperbusTburstMax = carfield_configuration::HyperBusBase + 32'h8;

// mailbox unit
parameter logic [31:0] CAR_MBOX_BASE = 32'h40000000;
Expand Down Expand Up @@ -178,9 +179,9 @@ module tb_carfield_soc;
bit safed_exit_status;
bit [31:0] safed_isolated;

localparam int unsigned SafetyIslandClkEnRegAddr = 32'h20010070;
localparam int unsigned SafetyIslandIsolateRegAddr = 32'h20010040;
localparam int unsigned SafetyIslandIsolateStatusRegAddr = 32'h20010058;
localparam int unsigned SafetyIslandClkEnRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SAFETY_ISLAND_CLK_EN_OFFSET;
localparam int unsigned SafetyIslandIsolateRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SAFETY_ISLAND_ISOLATE_OFFSET;
localparam int unsigned SafetyIslandIsolateStatusRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SAFETY_ISLAND_ISOLATE_STATUS_OFFSET;

initial begin
// Fetch plusargs or use safe (fail-fast) defaults
Expand Down Expand Up @@ -284,20 +285,20 @@ module tb_carfield_soc;
// pulp cluster standalone
if (CarfieldIslandsCfg.pulp.enable) begin: gen_pulp_tb
// Useful register addresses
localparam int unsigned CarL2StartAddr = 32'h7800_0000;
localparam int unsigned CarL2StartAddr = carfield_configuration::L2Port0Base;
localparam int unsigned CarDramStartAddr = 32'h8000_0000;
localparam int unsigned PulpdNumCores = 12;
localparam int unsigned PulpdBootAddrL2 = CarL2StartAddr + 32'h8080;
localparam int unsigned PulpdBootAddrDram = CarDramStartAddr + 32'h8080;
localparam int unsigned PulpdBootAddr = 32'h50200040;
localparam int unsigned PulpdRetAddr = 32'h50200100;
localparam int unsigned CarSocCtrlPulpdClkEnRegAddr = 32'h20010078;
localparam int unsigned CarSocCtrlPulpdIsolateRegAddr = 32'h20010048;
localparam int unsigned CarSocCtrlPulpdIsolateStatusRegAddr = 32'h20010060;
localparam int unsigned CarSocCtrlPulpdFetchEnAddr = 32'h200100c0;
localparam int unsigned CarSocCtrlPulpdBootEnAddr = 32'h200100dc;
localparam int unsigned CarSocCtrlPulpdBusyAddr = 32'h200100e4;
localparam int unsigned CarSocCtrlPulpdEocAddr = 32'h200100e8;
localparam int unsigned PulpdBootAddr = carfield_configuration::PulpClusterBase + 32'h00200040;
localparam int unsigned PulpdRetAddr = carfield_configuration::PulpClusterBase + 32'h00200100;
localparam int unsigned CarSocCtrlPulpdClkEnRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_CLK_EN_OFFSET;
localparam int unsigned CarSocCtrlPulpdIsolateRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_ISOLATE_OFFSET;
localparam int unsigned CarSocCtrlPulpdIsolateStatusRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_ISOLATE_STATUS_OFFSET;
localparam int unsigned CarSocCtrlPulpdFetchEnAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_FETCH_ENABLE_OFFSET;
localparam int unsigned CarSocCtrlPulpdBootEnAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_BOOT_ENABLE_OFFSET;
localparam int unsigned CarSocCtrlPulpdBusyAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_BUSY_OFFSET;
localparam int unsigned CarSocCtrlPulpdEocAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_PULP_CLUSTER_EOC_OFFSET;
// sim variables
string pulpd_preload_elf;
logic [1:0] pulpd_boot_mode;
Expand Down Expand Up @@ -440,9 +441,9 @@ module tb_carfield_soc;
doub_bt spatzd_binary_entry;
doub_bt spatzd_reg_value;

localparam int unsigned SpatzdClkEnRegAddr = 32'h2001007c;
localparam int unsigned SpatzdIsolateRegAddr = 32'h2001004c;
localparam int unsigned SpatzdIsolateStatusRegAddr = 32'h20010064;
localparam int unsigned SpatzdClkEnRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SPATZ_CLUSTER_CLK_EN_OFFSET;
localparam int unsigned SpatzdIsolateRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SPATZ_CLUSTER_ISOLATE_OFFSET;
localparam int unsigned SpatzdIsolateStatusRegAddr = carfield_configuration::PcrsBase + carfield_reg_pkg::CARFIELD_SPATZ_CLUSTER_ISOLATE_STATUS_OFFSET;

initial begin
// Fetch plusargs or use safe (fail-fast) defaults
Expand Down

0 comments on commit 1f5db55

Please sign in to comment.