diff --git a/Makefile b/Makefile index cd0bf8b..6295fba 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,7 @@ all: sim -sim: main.o Core.o Memory.o PipelineRegister.o - g++ main.o Core.o Memory.o PipelineRegister.o -o sim - -main.o: main.cpp Core.h Memory.h Register.h PipelineRegister.h - g++ -c main.cpp - -Core.o: Core.cpp Core.h Memory.h Register.h PipelineRegister.h - g++ -c Core.cpp - -Memory.o: Memory.cpp Memory.h - g++ -c Memory.cpp - -PipelineRegister.o: PipelineRegister.cpp PipelineRegister.h Register.h - g++ -c PipelineRegister.cpp +sim: + g++ -g -I include src/main.cpp src/Core.cpp src/Memory.cpp src/PipelineRegister.cpp -o ./bin/sim clean: - rm *.o sim \ No newline at end of file + rm -f bin/sim \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..cf8ef14 --- /dev/null +++ b/README @@ -0,0 +1,70 @@ +======================================================== +Functional & Pipeline Simulator for simpleRISC processor +======================================================== + +README + +Table of contents +1. Directory Structure +2. How to build +3. How to execute + +Directory Structure: +-------------------- +CSL211-Project + | + |- bin + | + |- sim + |- include + | + |- Core.h + |- Memory.h + |- PipelineRegister.h + |- Register.h + |- src + |- main.cpp + |- Core.cpp + |- Memory.cpp + |- PipelineRegister.cpp + |- test + |- simple_add.mem + |- fib.mem + |- array_add.mem + +How to build +------------ +For building: + $make + +For cleaning the project: + $make clean + +How to execute +-------------- +To run the functional program +./bin/sim test/ + +To run the pipeline program +./bin/sim test/ 1 + +To export the result for a test file eg. array_sum.mem with pipeline +./bin/sim test/array_sum.mem 1 > output + +The code generates a DATA_OUT.mem i.e. the complete memory at the termination of program +and a STATE_OUT.mem i.e. complete state of processor at the termination of program. + +The output contains instruction by instruction work done in each cycle in all stages namely - + +1. FETCH +2. DEOCDE +3. EXECUTE +4. MEMORY ACCESS +5. WRITEBACK + +Developed by +NAMAN GOYAL, 2015CSB1021 +EESHAAN SHARMA, 2015CSB1011 + + + diff --git a/README.txt b/README.txt deleted file mode 100644 index 393c045..0000000 --- a/README.txt +++ /dev/null @@ -1,38 +0,0 @@ -========================================== -SimpleRISC Functional & Pipeline Simulator -========================================== - -The project simulates SimpleRISC functional & pipeline processor using C++. - - -To compile and run the code in linux follow the follwing steps in the home directory of project folder. - -*To compile execute the following command in terminal -make - -*To run the functional program -./sim test/ - -*To run the pipeline program -./sim test/ 1 - -*To export the result for a test file eg. array_sum.mem with pipeline -./sim test/array_sum.mem 1 >output - -*To clean compiled code -make clean - -The code generates a DATA_OUT.mem i.e. the complete memory at the termination of program -and a STATE_OUT.mem i.e. complete state of processor at the termination of program. - -The output contains instruction by instruction work done in each cycle in all stages namely - - -1. FETCH -2. DEOCDE -3. EXECUTE -4. MEMORY ACCESS -5. WRITEBACK - -Developed by -NAMAN GOYAL, 2015CSB1021 -EESHAAN SHARMA, 2015CSB1011 diff --git a/Core.h b/include/Core.h similarity index 100% rename from Core.h rename to include/Core.h diff --git a/Memory.h b/include/Memory.h similarity index 100% rename from Memory.h rename to include/Memory.h diff --git a/PipelineRegister.h b/include/PipelineRegister.h similarity index 100% rename from PipelineRegister.h rename to include/PipelineRegister.h diff --git a/Register.h b/include/Register.h similarity index 100% rename from Register.h rename to include/Register.h diff --git a/Core.cpp b/src/Core.cpp similarity index 100% rename from Core.cpp rename to src/Core.cpp diff --git a/Memory.cpp b/src/Memory.cpp similarity index 100% rename from Memory.cpp rename to src/Memory.cpp diff --git a/PipelineRegister.cpp b/src/PipelineRegister.cpp similarity index 100% rename from PipelineRegister.cpp rename to src/PipelineRegister.cpp diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/test/branch.mem b/test/branch.mem deleted file mode 100644 index 552b4a1..0000000 --- a/test/branch.mem +++ /dev/null @@ -1,4 +0,0 @@ -0x0 0x90000003 -0x4 0x00448000 -0x8 0x01114000 -0xc 0x4cc00001 \ No newline at end of file diff --git a/test/nop.mem b/test/nop.mem deleted file mode 100644 index 20b2e6e..0000000 --- a/test/nop.mem +++ /dev/null @@ -1 +0,0 @@ -0x0 0x68000000 \ No newline at end of file