archi-project's People
archi-project's Issues
Simulator - rewriting now
I move the previous version simulator to Archi-Project1/simulator-old
Because the old version cannot handle the error dump very well, I try to modify the program.
Assembler - J-Type Instructions not implemented
J-Type Instructions (j
, jal
) are still missing. Need to implement jinst
and complete the instruction set.
Assembler cannot handle "lui" instruction
Simulator - instruction "lui" modifies $zero
The instruction lui
will modify the content of $zero
. Perhaps STATUS_HALT
and STATUS_CONTINUE
need more care?
Valgrind complains about uninitialised variable
Are these potential bugs or just false positives?
==30358== Memcheck, a memory error detector
==30358== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==30358== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==30358== Command: ./CMP
==30358==
Start simulator - custom mode
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017D3: Simulator::Simulator::report() (simulator.cpp:135)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017D3: Simulator::Simulator::report() (simulator.cpp:135)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F9A: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017D3: Simulator::Simulator::report() (simulator.cpp:135)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C42001: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017D3: Simulator::Simulator::report() (simulator.cpp:135)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017F6: Simulator::Simulator::report() (simulator.cpp:136)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017F6: Simulator::Simulator::report() (simulator.cpp:136)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F9A: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017F6: Simulator::Simulator::report() (simulator.cpp:136)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C42001: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017F6: Simulator::Simulator::report() (simulator.cpp:136)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401836: Simulator::Simulator::report() (simulator.cpp:138)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401836: Simulator::Simulator::report() (simulator.cpp:138)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401859: Simulator::Simulator::report() (simulator.cpp:139)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401859: Simulator::Simulator::report() (simulator.cpp:139)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F9A: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401859: Simulator::Simulator::report() (simulator.cpp:139)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C42001: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401859: Simulator::Simulator::report() (simulator.cpp:139)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401899: Simulator::Simulator::report() (simulator.cpp:141)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401899: Simulator::Simulator::report() (simulator.cpp:141)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F9A: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401899: Simulator::Simulator::report() (simulator.cpp:141)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C42001: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401899: Simulator::Simulator::report() (simulator.cpp:141)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018BC: Simulator::Simulator::report() (simulator.cpp:142)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018BC: Simulator::Simulator::report() (simulator.cpp:142)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018FC: Simulator::Simulator::report() (simulator.cpp:144)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018FC: Simulator::Simulator::report() (simulator.cpp:144)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F9A: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018FC: Simulator::Simulator::report() (simulator.cpp:144)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C42001: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4018FC: Simulator::Simulator::report() (simulator.cpp:144)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x40191F: Simulator::Simulator::report() (simulator.cpp:145)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x40191F: Simulator::Simulator::report() (simulator.cpp:145)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x40195F: Simulator::Simulator::report() (simulator.cpp:147)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x40195F: Simulator::Simulator::report() (simulator.cpp:147)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401982: Simulator::Simulator::report() (simulator.cpp:148)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x401982: Simulator::Simulator::report() (simulator.cpp:148)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4019C2: Simulator::Simulator::report() (simulator.cpp:150)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4019C2: Simulator::Simulator::report() (simulator.cpp:150)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41E3F: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4019E5: Simulator::Simulator::report() (simulator.cpp:151)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358== Conditional jump or move depends on uninitialised value(s)
==30358== at 0x1C41F67: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4019E5: Simulator::Simulator::report() (simulator.cpp:151)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
Finish simulator
==30358== Syscall param write(buf) points to uninitialised byte(s)
==30358== at 0x1C500CA: write (in /lib/libc.so.7)
==30358== by 0x1C4FA86: ??? (in /lib/libc.so.7)
==30358== by 0x1C4F678: ??? (in /lib/libc.so.7)
==30358== by 0x1BF366F: ??? (in /lib/libc.so.7)
==30358== by 0x1BD1AB9: exit (in /lib/libc.so.7)
==30358== by 0x400A15: (below main) (in /usr/home/otoha/work/Archi-Project/Project3/archi24/simulator/CMP)
==30358== Address 0x2419151 is 17 bytes inside a block of size 32,768 alloc'd
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x1C4F045: ??? (in /lib/libc.so.7)
==30358== by 0x1C4EF43: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FF63: ??? (in /lib/libc.so.7)
==30358== by 0x1C3FCA6: vfprintf_l (in /lib/libc.so.7)
==30358== by 0x1C3144F: fprintf (in /lib/libc.so.7)
==30358== by 0x4017AC: Simulator::Simulator::report() (simulator.cpp:134)
==30358== by 0x401B03: Simulator::Simulator::run() (simulator.cpp:174)
==30358== by 0x400D3E: main (main.cpp:34)
==30358== Uninitialised value was created by a heap allocation
==30358== at 0x100C2B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==30358== by 0x12A3B09: operator new(unsigned long) (in /usr/lib/libc++.so.1)
==30358== by 0x400D03: main (main.cpp:33)
==30358==
==30358==
==30358== HEAP SUMMARY:
==30358== in use at exit: 36,864 bytes in 2 blocks
==30358== total heap usage: 6 allocs, 4 frees, 4,352,312 bytes allocated
==30358==
==30358== LEAK SUMMARY:
==30358== definitely lost: 0 bytes in 0 blocks
==30358== indirectly lost: 0 bytes in 0 blocks
==30358== possibly lost: 0 bytes in 0 blocks
==30358== still reachable: 36,864 bytes in 2 blocks
==30358== suppressed: 0 bytes in 0 blocks
==30358== Reachable blocks (those to which a pointer was found) are not shown.
==30358== To see them, rerun with: --leak-check=full --show-reachable=yes
==30358==
==30358== For counts of detected and suppressed errors, rerun with: -v
==30358== ERROR SUMMARY: 40 errors from 35 contexts (suppressed: 0 from 0)
Include fatal exception in test case?
Should we include exception that halts the simulator? Although in the specs it seems to be valid, I'm not sure if the TAs would accept it.
Testcase02 - Number overflow won't happen in line 33
30 ;; Test corner case of 0x80000000
31 lw $s0, 8($zero)
32 ;; Add 1 to 0x80000000
33 addi $s1, $s0, 1 ;Overflow
0x80000000
in addi should be -2^31
After $s0 + 1
, it will be -2^31 + 1
which is not a case of number overflow.
Should it be 0x80000000 - 1
?
Bugs on DTLB and DPTE
Accept example 1 and 2.
But it got wrong hits/misses on example 3.
My answer | Correct answer
13 DTLB : | 13 DTLB :
14 # hits: 29 | 14 # hits: 26
15 # misses: 3 | 15 # misses: 6
16 | 16
21 DPageTable : | 21 DPageTable :
22 # hits: 0 | 22 # hits: 0
23 # misses: 3 | 23 # misses: 6
24 | 24
I found that it got extra three hits than correct answer.
Add test case "merge sort"
Add code.s
data.txt
.
Project 3's test case
After I use make
command, there are some error messages occur.
lua ../../mips-assembler/mips-as.lua code.s iimage.bin 0x324
lua: ../../mips-assembler/mips-as.lua:382: attempt to index global 'bit32' (a nil value)
stack traceback:
../../mips-assembler/mips-as.lua:382: in function 'binary'
../../mips-assembler/mips-as.lua:464: in function 'mipsas'
../../mips-assembler/mips-as.lua:481: in main chunk
[C]: ?
make: *** [iimage.bin] Error 1
Simulator - Can not handle byte and half-word access
Reviewing the spec now, there is something wrong in the data handler.
Dependency on $zero should not be stalled or forwarded
Since the content of the register $zero
is never changed, any dependency on the register is to be ignored. Current implementation of the simulator does not follow this behavior.
About bus in project 2
In archi09:
We miss a line of Number overflow in cycle: 12
.
In archi29, archi49:
The fwd from $31.
Simulator - Arithmetic instructions write to zero
Arithmetic instructions like add
, sub
, and
, or
currently don't check for Write to Zero exceptions, making the contents of $zero
writable.
Add jump instructions
Add J
, JAL
and JR
instructions.
Add store instructions
Add support for SW
, SH
and SB
instructions.
Simulator - bne, beq cannot handle the number overflow now
As title.
Simulator - Does not return to STATUS_NORMAL
When an exception occurs, STATUS_NORMAL
is never reached again, causing following lw
and possibly other instructions to fail. Probably introduced in 37658da.
Bug in address range check
Memory instructions other than those operating on bytes need to check for the whole word or half-word to be in the address range. Current implementation only ensures that the starting address is within range. See iLMS forum.
Bug in forwarding for store instructions
Currently only dependency on rs
is checked for the store instructions sw
, sh
and sb
. Dependency on rt
should also be forwarded.
Dependency issue on "jal" instruction
The instruction jal
writes to register $31
, the forwarding behavior in this situation needs to be clarified. Waiting for response at iLMS forum.
Should "lui" instruction accept negative constant?
It is not clear about whether we should accept a negative number as the constant in the assembly syntax of "lui" operation. Although legal and unambiguous, it does not make much sense to me.
-- Current regexp to extract the constant
local c = tonumber(string.match(s, ",%s*(%w+)"))
-- Should we change it to this?
local c = tonumber(string.match(s, ",%s*(%g+)"))
Testcase02 - Address overflow
In testcase2, line 19, 20:
;; Access memory at 0x7fffffff + 9 = 8
lw $s3, 9($s0) ;Overflow
The $s0 is 2147483647
, so $s0 + offset(signed) will be a negative number.
The simulator will dump the Address overflow error
and halt the simulation.
Bugs on DCACHE
In example 3,
My answer | Correct answer
5 DCache : | 5 DCache :
6 # hits: 11 | 6 # hits: 10
7 # misses: 21 | 7 # misses: 22
Assembler - Register names not recognized yet
Currently registers can only be addressed by numbers ($0
to $31
). Need to add support for register name mnemonics like $sp
or $ra
.
Project 1 simulator - bug in jump instruction
In JTypeExecution.cpp
, the mask to access the four bits of the program counter is 0xF000000
, where it should be 0xF0000000
.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.