Adding New Instruction to SimpleScalar (PISA) Toolset
For the last few days, I am looking at Simple scalar toolset for my research work. I need to add new instructions to SimpleScalar’s native Instruction Set Architecture (PISA). Adding new instruction to the simulator tool seems to be straight forward. But , adding new instructions to the GNU/Assembler for PISA seems to be little complecated. Eventhough there is a documents on how to add new instructions to the GNU/Assembler for ARM ISA, I couldn’t find one for PISA. I have to mention that I coundn’t find an analogy between ARM Assembler and the one for PISA!
Finally, after much trouble and with the help of Alex and Steve, I have managed to add new instructions to the SImpleScalar’s native ISA – PISA. The process is not hard if you are aware how the tool-set works.
Basically, you need to modify two files.
1] ../simplescalar/simpleutil-version_number/opcode/ss-opc.c
This is the file, where you tell the assembler about the new instructions by telling the opcode, type of instruction, etc.
2] ../simplescalar/simplesim-v.num/pisa-target/pisa.def
This is where you tell the software simulator on what to do when it enconters an instruction of the new type you inserted.
Please ask me for further details.. if anyone in interested on doing this!
This info was very heapful and thank you!
Hii, I wrote an article last year explaining how to add instructions to the simplescalar decode tree. It may be of use
http://www.irishsilicon.com/archives/2005/01/adding_instruct.html
Liam
Thanks for your link Liam!
Hi, i am looking for a way to get some realistic data patterns flowing across system buses (data or memory), and i was wondering if simplescalar toolset can give me that? Any suggestions? Thx
You might also want to check this out:
http://ce.et.tudelft.nl/%7Edemid/SSIAT/
Hi, I am wondering how to use the new instruction. Sample programs of SS are written in C. Should I can just call the new instruction as assemble code?
You are right. You need to either use inline assembly or you compile the program to assembly and then insert your code and assemble using your “new” assembler.
Hi, I have another question. How do I insert storage element, for example, a couple of more registers and make the assembler and simulator aware of this extension?, assuming I can manually change the assembly code (so not bothering the front-end compiler to recognize the new registers)
Thanks
Hi,
I am a new user of simplescalar, i need to detect scalar variables from array variables for splitting data cache for my research work but i don’t know how to do it.
Some one have proposed to me to add new instructions like load-scalar ,store-scalar, load-array and store-array but i have not any idea how to do it.
In another way I have found some indication about annotating code for detecting them but i have not found how to it.
Please if you have any idea that can help i appreciate your help .
Thank you
What I have discussed here is from the assembler to the lower level (the hardware). You add new (assembly) instructions to both the assembler and also the instruction set simulator (that simulates the hardware).
However, if I am right, if you need to identify scalars and vectors, you need to do it at a higher level in the compilation processor. I am not sure how you could do it at this level.
If I understood right your problem right, you need to change the compiler to compile scalar related load/store to a different set of instructions compared to vector related load/store.
HTH.
Similarly , How to add new instruction to gdb database ??
can anyone help me with the flow
Hi,
I want to add new instruction to the simplescalar, BGE and BGEF. I want to compare to register and based on the comparison result a jump is made. I added the following line to the pisa.def file. but the error 134 is happen.
error—————————————————–
bin.little/anagram inputs/words results/dummy.out
make[2]: *** [do-tests] Error 134
make[2]: Leaving directory `/home/mipscross/simplesim-3.0/tests-pisa’
make[1]: *** [tests] Error 2
make[1]: Leaving directory `/home/mipscross/simplesim-3.0/tests-pisa’
———————————————————-
#define BGE_IMPL \
{ \
SET_TPC(CPC + 8 + (OFS <= GPR(RT)) \
SET_NPC(CPC + 8 + (OFS << 2)); \
}
DEFINST(BGE, 0×25,
"bge", "s,t,j",
IntALU, F_CTRL|F_COND|F_DIRJMP,
DNA, DNA, DGPR(RS), DGPR(RT), DNA)
#define BGEF_IMPL \
{ \
SET_TPC(CPC + 8 + (OFS <= FPR_F(FT)) \
SET_NPC(CPC + 8 + (OFS << 2)); \
}
DEFINST(BGEF, 0x6f,
"bge", "S,T,j",
FloatCMP, F_CTRL|F_FPCOND|F_DIRJMP,
DNA, DNA, DFPR_F(FS), DFPR_F(FT), DNA)
———————————————————-
I appreciate any help.