This is my graduation project for B.Sc. in Electrical and Electricity Engineering.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
CPU.circcirc - 387.04 kB - 04/20/2019 at 13:55 |
|
|
opcodes.xlsxsheet - 105.94 kB - 04/20/2019 at 13:55 |
|
|
car_game.xlsxsheet - 108.61 kB - 04/20/2019 at 13:55 |
|
|
CONTROL_ROMS_DESC.xlsxsheet - 15.46 kB - 04/20/2019 at 13:55 |
|
|
logisim-evolution (2).jarJava Archive - 20.06 MB - 04/11/2019 at 18:17 |
|
Finally, finished first part of the game and animation and controls(left-right).
After the last log update I found a few bugs in my forwarding unit, sometime it was duplicate or delete opcode in pipe. For the temporary fix I cancelled forwarding and left only stalling pipe function. After this compiled all project and flashed it to my fpga and saw nothing on the screen. I spent about 4 days on finding what is wrong with my circuit. I decided to take out some signals from core unit and make a test bench for it and after the short time I discovered that logisim not set properly some register Active level bits in converting to VHDL code. After the fix I finally saw the first picture on the screen and it means that my planning is working!!! 😁
In pipeline architecture sometimes happens situation when one of the operand don't yet updated, but you need to use it already. For this situations may be 3 solutions.
1. Stall the pipeline until we get the new value.
2. Forwarding new value to stage that we need.
3. (Sofware) Enter NOP commands between the operations.
I went for 1 and 2. The main idea is to sign every command with 3 additional bits in control unit that will notice the pipe what register is source and another is destination, if opcode is using it.
We have 8 registers, so we can use another register of 6 bits(3 for destination and 3 for source) to mark and every latch of the stage we sending to data hazards control which doing comparisons of all stages and check if there is source/destination dependnces. If we have dependence between WB and one of the other stages, then we just forward the value, but if we still didn't get the new value from the ALU l, then we will stall the pipe until we got it.
First update, I already finished hardware implementation of CPU in Logisim simulator.
We have there:
IF segment for instructions. ROM with 16 bit address width. We will not need all of the memory, also Cyclone II don't have such a big amount of memory for implement 64kB. Logisim will create a kind of look-up table in VHDL, for every address value we will get it's data value. I started to write game code in pseudo Assembly and at the moment I have about 150 lines, every command takes 4 bytes. I guess all game will not exceed over 4kb.
ID segment for register fetching. Here we will navigate all registers to their destination. We have 8 registers: AX, BX, CX, DX, PSW, XP, YP, SP.
First four is for logic and arithmetic operations. PSW is flags register(zero, carry, sign, parity).
XP, YP - registers for coordinates on the screen.
SP - Stack Pointer.
BC segment is to simplify branch control of the pipeline. The segment calculates branch condition and also new address value to jump in one clock. If branch is take a place then pervious stage is wiped. Near to this segment we have Branch control box for buffer control signal and new address.
MEM segment - Read/Write memory, 1 byte each time. Also Push and pop commands, we have MUX for switch between memory address and stack pointer registers. Also we will use Dual-port RAM, that means CPU and PPU can access the RAM together and we will not need to control timings.
EXE segment for logic and arithmetic operations.
WB for navigation data flow.
Create an account to leave a comment. Already have an account? Log In.
Your endeavor is incredible. This endeavor has given me a lot to learn. I'd want to distribute it to the Geometry spot team so they can read it and apply something fresh to our ongoing efforts.
What a great project! I am preparing my own and looking for help on http://essaypapers.reviews/ as I can`t do it on my own. Maybe you know some good services to help me?
Become a member to follow this project and never miss any updates
Your endeavor is incredible. This endeavor has given me a lot to learn. I'd want to distribute it to the apkcort team so they can read it and apply something fresh to our ongoing efforts.