Skip to content

Commit 9da49eb

Browse files
SmephiteNavaneeth-KunhiPurayil
authored andcommitted
sw: Enable cluster IRQ for clint
1 parent a541d3c commit 9da49eb

6 files changed

Lines changed: 45 additions & 33 deletions

File tree

hw/system/spatz_cluster/src/generated/bootrom.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ module bootrom #(
2020
localparam int AddrBits = RomSize > 1 ? $clog2(RomSize) : 1;
2121

2222
const logic [RomSize-1:0][DataWidth-1:0] mem = {
23-
512'h000000000000000000000000000200000000000000100000000000000000000000000000000000020000000000001000ffdff06f10500073000380670003a383,
24-
512'h000383930583839301c383b30205ae030185a3831050007330461073008666133040267330431073800303130000133704858593000005973053107304c30313,
23+
512'h0000000000100000000000000000000000000000000000020000000000001000ffdff06f10500073000380670003a383000383930583839301c383b30205ae03,
24+
512'h0185a383105000733046107300666633000803373040267330461073008666133040267330431073800303130000133705858593000005973053107305c30313,
2525
512'h0000031700000f9300000f1300000e9300000e1300000d9300000d1300000c9300000c1300000b9300000b1300000a9300000a13000009930000091300000893,
2626
512'h00000813000007930000071300000693000006130000059300000513000004930000041300000393000003130000029300000213000001930000011300000093
2727
};

hw/system/spatz_cluster/src/generated/spatz_cluster_wrapper.sv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ package spatz_cluster_pkg;
5858

5959
localparam int unsigned TCDMStartAddr = 32'h100000;
6060
localparam int unsigned TCDMSize = 32'h20000;
61-
61+
localparam logic AddrMisalign = 1'b0; // 0-aligned, 1-misalign
6262
localparam int unsigned PeriStartAddr = TCDMStartAddr + TCDMSize;
6363

6464
localparam int unsigned BootAddr = 32'h1000;
@@ -243,6 +243,7 @@ module spatz_cluster_wrapper
243243
localparam int unsigned NumSpatzOutstandingLoads [NumCores] = '{4, 4};
244244
localparam int unsigned NumSpatzFPUs [NumCores] = '{default: 4};
245245
localparam int unsigned NumSpatzIPUs [NumCores] = '{default: 1};
246+
localparam int unsigned NumSpatzTCDMPorts [NumCores] = '{default: 4};
246247

247248
typedef logic [IwcAxiIdOutWidth-1:0] axi_id_out_iwc_t;
248249

@@ -302,6 +303,8 @@ module spatz_cluster_wrapper
302303
.NumSpatzOutstandingLoads (NumSpatzOutstandingLoads),
303304
.NumSpatzFPUs (NumSpatzFPUs),
304305
.NumSpatzIPUs (NumSpatzIPUs),
306+
.NumSpatzTCDMPorts (NumSpatzTCDMPorts),
307+
.AddrMisalign (AddrMisalign),
305308
.axi_in_req_t (axi_in_req_t),
306309
.axi_in_resp_t (axi_in_resp_t),
307310
.axi_out_req_t (spatz_axi_iwc_out_req_t),

hw/system/spatz_cluster/test/bootrom.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ _start:
5353
csrr a2, mie
5454
ori a2, a2, 0x8
5555
csrw mie, a2
56+
// Activate MCIP
57+
csrr a2, mie
58+
li t1, 0x80000
59+
or a2, a2, t1
60+
csrw mie, a2
5661

5762
// Wait for the wakeup interrupt
5863
wfi
16 Bytes
Binary file not shown.

hw/system/spatz_cluster/test/bootrom.dump

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,54 +37,58 @@ Disassembly of section .text:
3737
1074: 00000f13 li t5,0
3838
1078: 00000f93 li t6,0
3939
107c: 00000317 auipc t1,0x0
40-
1080: 04c30313 addi t1,t1,76 # 10c8 <dummy_exception>
40+
1080: 05c30313 addi t1,t1,92 # 10d8 <dummy_exception>
4141
1084: 30531073 csrw mtvec,t1
4242
1088: 00000597 auipc a1,0x0
43-
108c: 04858593 addi a1,a1,72 # 10d0 <BOOTDATA>
43+
108c: 05858593 addi a1,a1,88 # 10e0 <BOOTDATA>
4444
1090: 00001337 lui t1,0x1
4545
1094: 80030313 addi t1,t1,-2048 # 800 <_start-0x800>
4646
1098: 30431073 csrw 0x304,t1
4747
109c: 30402673 csrr a2,0x304
4848
10a0: 00866613 ori a2,a2,8
4949
10a4: 30461073 csrw 0x304,a2
50-
10a8: 10500073 wfi
51-
10ac: 0185a383 lw t2,24(a1)
52-
10b0: 0205ae03 lw t3,32(a1)
53-
10b4: 01c383b3 add t2,t2,t3
54-
10b8: 05838393 addi t2,t2,88
55-
10bc: 00038393 mv t2,t2
56-
10c0: 0003a383 lw t2,0(t2)
57-
10c4: 00038067 jr t2
50+
10a8: 30402673 csrr a2,0x304
51+
10ac: 00080337 lui t1,0x80
52+
10b0: 00666633 or a2,a2,t1
53+
10b4: 30461073 csrw 0x304,a2
54+
10b8: 10500073 wfi
55+
10bc: 0185a383 lw t2,24(a1)
56+
10c0: 0205ae03 lw t3,32(a1)
57+
10c4: 01c383b3 add t2,t2,t3
58+
10c8: 05838393 addi t2,t2,88
59+
10cc: 00038393 mv t2,t2
60+
10d0: 0003a383 lw t2,0(t2)
61+
10d4: 00038067 jr t2
5862

59-
000010c8 <dummy_exception>:
60-
10c8: 10500073 wfi
61-
10cc: ffdff06f j 10c8 <dummy_exception>
63+
000010d8 <dummy_exception>:
64+
10d8: 10500073 wfi
65+
10dc: ffdff06f j 10d8 <dummy_exception>
6266

6367
Disassembly of section .rodata:
6468

65-
000010d0 <BOOTDATA>:
66-
10d0: 1000 addi s0,sp,32
67-
10d2: 0000 unimp
68-
10d4: 0000 unimp
69-
10d6: 0000 unimp
70-
10d8: 0002 0x2
71-
...
72-
10ea: 0010 addi a2,sp,0
73-
10ec: 0000 unimp
74-
10ee: 0000 unimp
75-
10f0: 0000 unimp
76-
10f2: 0002 0x2
69+
000010e0 <BOOTDATA>:
70+
10e0: 1000 addi s0,sp,32
71+
10e2: 0000 unimp
72+
10e4: 0000 unimp
73+
10e6: 0000 unimp
74+
10e8: 0002 0x2
7775
...
76+
10fa: 0010 addi a2,sp,0
77+
10fc: 0000 unimp
78+
10fe: 0000 unimp
7879
1100: 0000 unimp
79-
1102: 8000 0x8000
80+
1102: 0002 0x2
81+
...
82+
1110: 0000 unimp
83+
1112: 8000 0x8000
8084
...
81-
110c: 0001 nop
85+
111c: 0001 nop
8286
...
8387

8488
Disassembly of section .boot_section:
8589

86-
00001110 <entry_addr>:
87-
1110: 10c8 addi a0,sp,100
90+
00001120 <entry_addr>:
91+
1120: 10d8 addi a4,sp,100
8892
...
8993

9094
Disassembly of section .Pulp_Chip.Info:
@@ -101,7 +105,7 @@ Disassembly of section .Pulp_Chip.Info:
101105
10: 495f 666e 006f 0x6f666e495f
102106
16: 70696863 bltu s2,t1,726 <_start-0x8da>
103107
1a: 6e3d lui t3,0xf
104-
1c: 20656e6f jal t3,56222 <entry_addr+0x55112>
108+
1c: 20656e6f jal t3,56222 <entry_addr+0x55102>
105109
20: 3d757063 bleu s7,a0,3e0 <_start-0xc20>
106110
24: 6f6e flw ft10,216(sp)
107111
26: 656e flw fa0,216(sp)
16 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)