Alright maybe no one can really help me on this so I'll try to keep it general.
We need to design (use a circuit/logic simulation program from our school) a multi-cycle CPU. It's very close to a MIPS implementation, except that words are 16 bits instead of 32 bits.
So it's based off the the multi-cycle CPUs in the Henessey and Patterson book.
Now, the requirement for this CPU which is totally killing me is the memory access time must be 2000 (doesn't matter units). With the default access time of 200, my CPU works fine for the instructions I've done so far (add, sub, lw, sw, beq, bne). But changing it to the required 2000 totally messes things up.
Since the memory takes about a whole cycle to just read it, the rest of my states (multi cycle CPU control signals are implemented with a state machine) get messed up. We can add delay elements, but I have no clue where. Basicaly the states are:
fetch instruction, so it reads the program counter's default address of 0, but the instruction/data memory requires an access time of 2000. My cycle time is 2000 (I've experimented up to 3500, but I know 2000 is a rough start).
decode instruction: here it assumes the memory has read out the instruction and then procedes to load it into the instruction register and decode what registers and operation to perform. The problem is that it gets to this state before the memory has read the instruction, so it decodes 0000, which is interepted as a HALT instruction, thus stops.
Anyone have any ideas on how I can choose a cycle time and one time? I have no idea how to determine the one time (the time the clock is high). My registers are all negative-edge triggered, but I've tried some of them as positive or level, but stil it doesn't work.
We need to design (use a circuit/logic simulation program from our school) a multi-cycle CPU. It's very close to a MIPS implementation, except that words are 16 bits instead of 32 bits.
So it's based off the the multi-cycle CPUs in the Henessey and Patterson book.
Now, the requirement for this CPU which is totally killing me is the memory access time must be 2000 (doesn't matter units). With the default access time of 200, my CPU works fine for the instructions I've done so far (add, sub, lw, sw, beq, bne). But changing it to the required 2000 totally messes things up.
Since the memory takes about a whole cycle to just read it, the rest of my states (multi cycle CPU control signals are implemented with a state machine) get messed up. We can add delay elements, but I have no clue where. Basicaly the states are:
fetch instruction, so it reads the program counter's default address of 0, but the instruction/data memory requires an access time of 2000. My cycle time is 2000 (I've experimented up to 3500, but I know 2000 is a rough start).
decode instruction: here it assumes the memory has read out the instruction and then procedes to load it into the instruction register and decode what registers and operation to perform. The problem is that it gets to this state before the memory has read the instruction, so it decodes 0000, which is interepted as a HALT instruction, thus stops.
Anyone have any ideas on how I can choose a cycle time and one time? I have no idea how to determine the one time (the time the clock is high). My registers are all negative-edge triggered, but I've tried some of them as positive or level, but stil it doesn't work.