Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for cpu_forwarded->test_forwarded_arith fails #2

Open
jlusiardi opened this issue Oct 21, 2019 · 2 comments
Open

Test for cpu_forwarded->test_forwarded_arith fails #2

jlusiardi opened this issue Oct 21, 2019 · 2 comments

Comments

@jlusiardi
Copy link
Contributor

There seems to be an issue while running the test bench:

The program should store 8 into mem address 123.

The check is kind of strange:

  cout << "top->MEM[123] = " << ((int)top->MEM[1000]) << endl;
  assert(top->MEM[123] == ((8 + 1000) + 1000));

Complete output of test:

make: Entering directory '/home/jlusiardi/Dokumente/src/TinyCPU_orig/obj_dir'
make: 'Vcpu_forwarded' is up to date.
make: Leaving directory '/home/jlusiardi/Dokumente/src/TinyCPU_orig/obj_dir'
Testing arithmetic result forwarding
Instruction being issued  = 00000000000000000000000000000000
decode_ireg_out           = 00000000000000000000000000000000
execute_ireg_out          = 00000000000000000000000000000000
memory_ireg_out           = 00000000000000000000000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
Instruction being issued  = 00000000000000000000000000000000
decode_ireg_out           = 00000000000000000000000000000000
execute_ireg_out          = 00000000000000000000000000000000
memory_ireg_out           = 00000000000000000000000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =          0
Memory read address 0          0
Memory read address 1          0
Instruction being issued  = 00001000000000000100000000000000
decode_ireg_out           = 00000000000000000000000000000000
execute_ireg_out          = 00000000000000000000000000000000
memory_ireg_out           = 00000000000000000000000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =          0
Memory read address 0          1
Memory read address 1          0
Instruction being issued  = 00001000000111110100000001000000
decode_ireg_out           = 00001000000000000100000000000000
execute_ireg_out          = 00000000000000000000000000000000
memory_ireg_out           = 00000000000000000000000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 1
operand 1 written by exe = 1
forwarded alu result     =          0
Memory read address 0          2
Memory read address 1          0
Instruction being issued  = 00101000000000100010000110000000
decode_ireg_out           = 00001000000111110100000001000000
execute_ireg_out          = 00001000000000000100000000000000
memory_ireg_out           = 00000000000000000000000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 1
forwarded alu result     =          0
Memory read address 0          3
Memory read address 1          0
Instruction being issued  = 00101000010001000011001010000000
decode_ireg_out           = 00101000000000100010000110000000
execute_ireg_out          = 00001000000111110100000001000000
memory_ireg_out           = 00001000000000000100000000000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 1
forwarded alu result     =          0
Memory read address 0          4
Memory read address 1          0
Writing          8 to register  0

Instruction being issued  = 00001000000000111101100001000000
decode_ireg_out           = 00101000010001000011001010000000
execute_ireg_out          = 00101000000000100010000110000000
memory_ireg_out           = 00001000000111110100000001000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =          0
Memory read address 0          5
Memory read address 1          0
Writing       1000 to register  1

Instruction being issued  = 00011000000000100000000000000000
decode_ireg_out           = 00001000000000111101100001000000
execute_ireg_out          = 00101000010001000011001010000000
memory_ireg_out           = 00101000000000100010000110000000
read_data_0               =          0
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 1
forwarded alu result     =          0
Memory read address 0          6
Memory read address 1          0
Writing          0 to register  2

Instruction being issued  = 00000000000000000000000000000000
decode_ireg_out           = 00011000000000100000000000000000
execute_ireg_out          = 00001000000000111101100001000000
memory_ireg_out           = 00101000010001000011001010000000
read_data_0               =          8
read_data_1               =          0
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =          8
Memory read address 0          7
Memory read address 1          0
Writing          0 to register  3

Instruction being issued  = 00000000000000000000000000000000
decode_ireg_out           = 00000000000000000000000000000000
execute_ireg_out          = 00011000000000100000000000000000
memory_ireg_out           = 00001000000000111101100001000000
read_data_0               =          8
read_data_1               =       1000
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =       1000
Memory read address 0          8
Memory read address 1          8
Writing 00000000000000000000000000001000 to memory address 00000000000000000000000000000000
Writing        123 to register  1

Instruction being issued  = 00000000000000000000000000000000
decode_ireg_out           = 00000000000000000000000000000000
execute_ireg_out          = 00000000000000000000000000000000
memory_ireg_out           = 00011000000000100000000000000000
read_data_0               =          8
read_data_1               =       1000
stall                     = 0
squash                    = 0
operand 0 written by exe = 0
operand 1 written by exe = 0
forwarded alu result     =       1000
Memory read address 0          9
Memory read address 1          8
top->MEM[123] = 0
Vcpu_forwarded: ../cpu_forwarded_main.cpp:256: void test_forwarded_arith(int, char**): Assertion `top->MEM[123] == ((8 + 1000) + 1000)' failed.
Aborted
ERROR: cpu_forwarded tests failed
Traceback (most recent call last):
  File "test_bench.py", line 10, in <module>
    build_module('cpu_forwarded', '-Icommon -Icpu_forwarded')
  File "/home/jlusiardi/Dokumente/src/TinyCPU_orig/testbench_utils.py", line 35, in build_module
    build_module_with_main(mod_name, mod_name + '_main.cpp', flags)
  File "/home/jlusiardi/Dokumente/src/TinyCPU_orig/testbench_utils.py", line 32, in build_module_with_main
    assert(False)
AssertionError
@jlusiardi
Copy link
Contributor Author

Ok, I found https://www.dillonbhuff.com/?p=1558 stating that the forwarded "version is a pipelined CPU with forwarding of operands to reduce stalling. It is unfinished.".

So unclear if close is correct here?

@dillonhuff
Copy link
Owner

I would just leave it open. If I do eventually find time to deal with this problem I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants