Skip to content

Commit

Permalink
'--permissive-dual-issue' now disallows two enabled load/store.
Browse files Browse the repository at this point in the history
This is because implemented allowing that in hardware would be difficult.
  • Loading branch information
Emoun committed Sep 5, 2023
1 parent 8203a59 commit 4b3edc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
11 changes: 5 additions & 6 deletions src/simulation-core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,13 @@ namespace patmos

if(pred0 && pred1) {
boost::optional<const char*> err;
if(pipe_instr0.I->is_load() && pipe_instr1.I->is_load()) {
err = "loads";
}
if(pipe_instr0.I->is_store() && pipe_instr1.I->is_store()) {
err = "stores";
if((pipe_instr0.I->is_load() || pipe_instr0.I->is_store()) &&
(pipe_instr1.I->is_load() || pipe_instr1.I->is_store())
) {
err = "load/store";
}
if(pipe_instr0.I->is_flow_control() && pipe_instr1.I->is_flow_control()) {
err = "control flows";
err = "control flows";
}

if(err) {
Expand Down
9 changes: 4 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ Errors : 0")
test_asm(58 "Emitted: 52 bytes
Errors : 0")

test_asm(59 "Emitted: 56 bytes
Errors : 0")
test_asm(59 "Errors : 0")

test_asm(60 "Emitted: 128 bytes
Errors : 0")
Expand Down Expand Up @@ -372,15 +371,15 @@ test_sim(55 "\\\\\\[Error\\\\\\] Illegal instruction: 8a861180.*PC : 00000014")

test_sim_arg(55 "--permissive-dual-issue" "r3 : 0000007b r4 : 000001c8")

test_sim_arg(56 "--permissive-dual-issue" "\\\\\\[Error\\\\\\] Illegal instruction: Two simultaneously enabled loads.*\\\\\\( p1\\\\\\) lwm r3 = \\\\\\[r1 \\\\\\+ 0\\\\\\]")
test_sim_arg(56 "--permissive-dual-issue" "\\\\\\[Error\\\\\\] Illegal instruction: Two simultaneously enabled load/store.*\\\\\\( p1\\\\\\) lwm r3 = \\\\\\[r1 \\\\\\+ 0\\\\\\]")

test_sim(57 "\\\\\\[Error\\\\\\] Illegal instruction: 92c61180.*PC : 00000024")

test_sim_arg(57 "--permissive-dual-issue" "r5 : 0000000c r6 : 00000022")

test_sim_arg(58 "--permissive-dual-issue" "\\\\\\[Error\\\\\\] Illegal instruction: Two simultaneously enabled stores.*\\\\\\( p1\\\\\\) swm \\\\\\[r1 \\\\\\+ 0\\\\\\] = r3")
test_sim_arg(58 "--permissive-dual-issue" "\\\\\\[Error\\\\\\] Illegal instruction: Two simultaneously enabled load/store.*\\\\\\( p1\\\\\\) swm \\\\\\[r1 \\\\\\+ 0\\\\\\] = r3")

test_sim_arg(59 "--permissive-dual-issue" "r4 : 0000007b r5 : 000001c8")
test_sim_arg(59 "--permissive-dual-issue" "\\\\\\[Error\\\\\\] Illegal instruction: Two simultaneously enabled load/store.*\\\\\\( p7\\\\\\) lwc r3 = \\\\\\[r0 \\\\\\+ 0\\\\\\]")

test_sim(60 "\\\\\\[Error\\\\\\] Illegal instruction: c4c00008.*PC : 00000014")

Expand Down
16 changes: 6 additions & 10 deletions tests/test59.s
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#
# Tests can have store and load enabled at the same time
# Tests two enabled loads and stores in the same bundle
#

.word 60;
addi r1 = r0, DUMMY1;
addi r2 = r0, DUMMY2;
addi r3 = r0, 456;
pand p3 = p0, p0
(p3) swm [r2] = r3 || (p0) lwm r4 = [r1]
lwm r5 = [r2]
.word 100;
addi r1 = r0, dummy;
pand p7 = p0, p0;
(p7) lwc r3 = [0] || (p7) swc [0] = r2;
halt;
nop;
nop;
nop;
dummy: .word 0;

DUMMY1: .word 123;
DUMMY2: .word 0;

0 comments on commit 4b3edc3

Please sign in to comment.