hi,
I want to simulate something about transaction, and it needs two register ,
one is to save the thread ID witch transaction belong to, another is
to save the transaction state. I do not know if there has been two
registers working as above, if not how can I add two registers in
gems.
I have tried to add two registers as fallowig:
**************************************
in pstate.C
const char
*pstate_t::control_reg_menomic[CONTROL_TRANSACTION_STATE] = {
/* CONTROL_PC
*/
"pc", /* CONTROL_NPC
*/
"npc",
.............
/*CONTROL_TRANSACTION_THREAD*/
"ttr" //-----------added by me
/*CONTROL_TRANSACTION_STATE*/
"tsr" //-----------added by me
}
in Targetmacros.h
enum control_reg_t
{ CONTROL_PC =
0, CONTROL_NPC,
.........
CONTROL_TRANSACTION_THREAD,
//---------added by me
CONTROL_TRANSACTION_THREAD
//---------added by me
}
in regbox.C, pseq.C ......
m_control_map[i] = (byte_t *) malloc(
sizeof(byte_t) * CONTROL_TRANSACTION_STATE); //modify it instead of
"m_control_map[i] = (byte_t*) malloc( sizeof(byte_t)*
CONTROL_NUM_CONTROL_TYPES);" for ( reg = 0;
reg < CONTROL_TRANSACTION_STATE; reg++ ) //modify it
instead of "for ( reg = 0; reg < CONTROL_NUM_CONTROL_TYPES; reg++ )
**************************************
when I run a test on target machine, simics was stoped with " Exception in hap handler: Non-existent
Register"
Is there anyone can tell me how to add two registers in gems? thanks
anyway!
2009-07-21
lenglihello
|