Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
CAOS_HW
HDL_IP
SafeSU
Commits
49f42976
Commit
49f42976
authored
May 25, 2021
by
GuillemCabo
Committed by
Guillem
Nov 23, 2021
Browse files
hold interrupts unitl reset
parent
59815c21
Changes
4
Show whitespace changes
Inline
Side-by-side
submodules/MCCU/hdl/MCCU.sv
View file @
49f42976
...
...
@@ -265,16 +265,31 @@
by how much the quota was exceeded. Interruption is only generated if the
MCCU is enabled
----------*/
wire
interruption_quota_d
[
N_CORES
-
1
:
0
];
reg
interruption_quota_q
[
N_CORES
-
1
:
0
];
for
(
x
=
0
;
x
<
N_CORES
;
x
=
x
+
1
)
begin
:
InterruptionQuota
assign
interruption_quota_
o
[
x
]
=
assign
interruption_quota_
d
[
x
]
=
!
enable_i
?
1'b0
:
(
ccc_suma_int
[
x
]
>{{
O_D_0PAD
{
1'b0
}}
,
quota_int
[
x
]
}
)
?
1'b1
:
1'b0
;
end
for
(
x
=
0
;
x
<
N_CORES
;
x
=
x
+
1
)
begin
:
InterruptionQuotaHold
always
@
(
posedge
clk_i
)
begin
if
(
rstn_i
==
1'b0
)
begin
interruption_quota_q
[
x
]
<=
'
{
default
:
'0
}
;
end
else
begin
interruption_quota_q
[
x
]
<=
interruption_quota_d
[
x
]
|
interruption_quota_q
[
x
];
end
end
end
assign
interruption_quota_o
=
interruption_quota_q
;
`ifdef
ASSERTIONS
always
@
(
posedge
clk_i
)
begin
for
(
integer
x
=
0
;
x
<
N_CORES
;
x
=
x
+
1
)
begin
:
InterruptionQuota
if
(
quota_int
[
x
]
>
ccc_suma_int
[
x
])
assert
(
interruption_quota_
o
[
x
]
==
1'b0
);
assert
(
interruption_quota_
d
[
x
]
==
1'b0
);
end
end
`endif
...
...
@@ -356,6 +371,7 @@ Section of Formal propperties, valid for SBY
assert
(
interruption_quota_o
[
k
]
==
enable_i
);
end
else
begin
//interruption shall be disabled regardless of enable_i
//TODO: if we retain the previous state (hold interrupt) this does not apply
assert
(
interruption_quota_o
[
k
]
==
1'b0
);
end
end
...
...
submodules/MCCU/tb/questa_sim/runtest.sh
View file @
49f42976
...
...
@@ -6,7 +6,7 @@ then
vmap work
$PWD
/MCCU
vlog +acc
=
rn +incdir+../../hdl/ ../../hdl/
*
.sv tb_MCCU.sv
vmake MCCU/
>
Makefile
vsim work.tb_MCCU
-do
"view wave -new"
-do
"do wave.do"
-do
"run
40000
"
vsim work.tb_MCCU
-do
"view wave -new"
-do
"do wave.do"
-do
"run
-all
"
else
vlib MCCU
vmap work
$PWD
/MCCU
...
...
submodules/MCCU/tb/questa_sim/tb_MCCU.sv
View file @
49f42976
...
...
@@ -109,6 +109,7 @@ task automatic init_sim;
begin
int
tmp
=
0
;
disable_MCCU
;
reset_dut
;
//rise all events
if
(
events_i
)
begin
rise_event
(
0
,
0
);
...
...
@@ -417,6 +418,7 @@ task automatic init_sim;
task
automatic
get_interrupt
;
input
core_i
;
output
int
unsigned
value_o
;
#
CLK_PERIOD
value_o
=
tb_interruption_quota_o
[
core_i
];
$
display
(
"get quota of core: %d remaining quota: %d"
,
core_i
,
value_o
);
if
((
core_i
>
TB_N_CORES
))
begin
...
...
submodules/MCCU/tb/questa_sim/wave.do
View file @
49f42976
...
...
@@ -4,17 +4,20 @@ add wave -noupdate -height 40 /tb_MCCU/dut_MCCU/clk_i
add wave -noupdate -height 40 /tb_MCCU/dut_MCCU/rstn_i
add wave -noupdate -height 40 /tb_MCCU/dut_MCCU/enable_i
add wave -noupdate -height 40 -radix decimal /tb_MCCU/dut_MCCU/quota_i
add wave -noupdate -height 40 -radix decimal /tb_MCCU/dut_MCCU/quota_int
add wave -noupdate -height 40 -radix decimal
-childformat {{{/tb_MCCU/dut_MCCU/quota_int[0]} -radix decimal} {{/tb_MCCU/dut_MCCU/quota_int[1]} -radix decimal} {{/tb_MCCU/dut_MCCU/quota_int[2]} -radix decimal} {{/tb_MCCU/dut_MCCU/quota_int[3]} -radix decimal}} -expand -subitemconfig {{/tb_MCCU/dut_MCCU/quota_int[0]} {-radix decimal} {/tb_MCCU/dut_MCCU/quota_int[1]} {-radix decimal} {/tb_MCCU/dut_MCCU/quota_int[2]} {-radix decimal} {/tb_MCCU/dut_MCCU/quota_int[3]} {-radix decimal}}
/tb_MCCU/dut_MCCU/quota_int
add wave -noupdate -height 40 -radix decimal /tb_MCCU/dut_MCCU/quota_o
add wave -noupdate -height 40 /tb_MCCU/dut_MCCU/interruption_quota_o
add wave -noupdate -height 40 -radix unsigned -childformat {{{/tb_MCCU/dut_MCCU/events_weights_i[0]} -radix unsigned}
} -expand -subitemconfig {{/tb_MCCU/dut_MCCU/events_weights_i[0]} {-height 40
-radix unsigned}} /tb_MCCU/dut_MCCU/events_weights_i
add wave -noupdate -height 40
-expand
/tb_MCCU/dut_MCCU/interruption_quota_o
add wave -noupdate -height 40 -radix unsigned -childformat {{{/tb_MCCU/dut_MCCU/events_weights_i[0]} -radix unsigned}
{{/tb_MCCU/dut_MCCU/events_weights_i[1]} -radix unsigned} {{/tb_MCCU/dut_MCCU/events_weights_i[2]} -radix unsigned} {{/tb_MCCU/dut_MCCU/events_weights_i[3]} -radix unsigned}} -expand -subitemconfig {{/tb_MCCU/dut_MCCU/events_weights_i[0]} {-height 40 -radix unsigned} {/tb_MCCU/dut_MCCU/events_weights_i[1]} {-height 31 -radix unsigned} {/tb_MCCU/dut_MCCU/events_weights_i[2]} {-height 31 -radix unsigned} {/tb_MCCU/dut_MCCU/events_weights_i[3]} {-height 31
-radix unsigned}} /tb_MCCU/dut_MCCU/events_weights_i
add wave -noupdate -height 40 /tb_MCCU/dut_MCCU/events_i
add wave -noupdate /tb_MCCU/dut_MCCU/update_quota_i
add wave -noupdate /tb_MCCU/dut_MCCU/ccc_suma_int
add wave -noupdate /tb_MCCU/dut_MCCU/interruption_quota_d
add wave -noupdate /tb_MCCU/dut_MCCU/interruption_quota_q
add wave -noupdate -radix ascii /tb_MCCU/tb_test_name
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {
2
4000 ps} 0}
WaveRestoreCursors {{Cursor 1} {
1
4000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth
2
59
configure wave -namecolwidth 59
2
configure wave -valuecolwidth 169
configure wave -justifyvalue left
configure wave -signalnamewidth 0
...
...
@@ -28,4 +31,4 @@ configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {
0
ps} {
76223
ps}
WaveRestoreZoom {
509
ps} {
57774
ps}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment