03-10-2015, 07:46 PM
have you done variable length instructions before?
Also, I would suggest getting rid of the bloat inst. In there that you will almost never use. 8 bit opcode can be a bit much to decode each one then encode to the control lines.
5 bit opcode seems to be a good common ground (for MC) between lots of ops and size of system.
8bit opcode CPU in MC would end up being about 50%+ just inst decoding.
One more suggestion about variable length..
I have have used 2 different ideas for there decoding.
1. Have a queue that can variable read (can read from each slot based on the Inst).
Being such that you always have X (X being equal to the max byte size of ur longest inst) lines (bytes) of code stored at any given time.
Decode the oldest value in the queue and based on the op the decoding system chooses how many values to read.
The next clock pulse after that comes, blankly shift (disable read from all the bytes that you used for the prior inst) the queue so you don't double read part of a multi line op in the next cycle.
2. Kinda that way but figure out a way to incorporate that queue into you actual processing stages. For this I ended up moving around the byte layout for my Branch (my longest opcode in byte length) so the bytes would align with my pipeline as to be where they need to be on the stage they are needed.
Option 1 is MUCH MUCH easier... I had to tweak and tweak and tweak that way to work better and better, and in that process slowly went to the 2nd option, by removing 1 stage at a time..
went from a 3 stage queue being before all decoding, to prefetch (decode some before it goes into queue) some of the ops so I would have inst. Data where I needed it when I needed it.
then I removed a stage and incorporated that into my pipeline.
InfaCT I just got rid of the last part of the queue last night all together so my lengths are decoded just as a normal op code. so all ops process at the same rate that a standard ALU op does. (Grant it the multi line gives u x-1 extra cycles to work with since u only read 1 line at a time)
Sorry if that is a TL;DR... for those of you that did TLDR
-Suggest lowering the amount of op codes, 8bit is high IMO
-and look into a queue system thing for the variable length, and tweak that down to where the queue is unnecessary.
Just my little tips/suggestions. Don't have to go by them if u don't want.
good luck on the build! Ask if you would like my help with anything
Also, I would suggest getting rid of the bloat inst. In there that you will almost never use. 8 bit opcode can be a bit much to decode each one then encode to the control lines.
5 bit opcode seems to be a good common ground (for MC) between lots of ops and size of system.
8bit opcode CPU in MC would end up being about 50%+ just inst decoding.
One more suggestion about variable length..
I have have used 2 different ideas for there decoding.
1. Have a queue that can variable read (can read from each slot based on the Inst).
Being such that you always have X (X being equal to the max byte size of ur longest inst) lines (bytes) of code stored at any given time.
Decode the oldest value in the queue and based on the op the decoding system chooses how many values to read.
The next clock pulse after that comes, blankly shift (disable read from all the bytes that you used for the prior inst) the queue so you don't double read part of a multi line op in the next cycle.
2. Kinda that way but figure out a way to incorporate that queue into you actual processing stages. For this I ended up moving around the byte layout for my Branch (my longest opcode in byte length) so the bytes would align with my pipeline as to be where they need to be on the stage they are needed.
Option 1 is MUCH MUCH easier... I had to tweak and tweak and tweak that way to work better and better, and in that process slowly went to the 2nd option, by removing 1 stage at a time..
went from a 3 stage queue being before all decoding, to prefetch (decode some before it goes into queue) some of the ops so I would have inst. Data where I needed it when I needed it.
then I removed a stage and incorporated that into my pipeline.
InfaCT I just got rid of the last part of the queue last night all together so my lengths are decoded just as a normal op code. so all ops process at the same rate that a standard ALU op does. (Grant it the multi line gives u x-1 extra cycles to work with since u only read 1 line at a time)
Sorry if that is a TL;DR... for those of you that did TLDR
-Suggest lowering the amount of op codes, 8bit is high IMO
-and look into a queue system thing for the variable length, and tweak that down to where the queue is unnecessary.
Just my little tips/suggestions. Don't have to go by them if u don't want.
good luck on the build! Ask if you would like my help with anything