A
Andreas
Guest
Hi!
I'm working with systemC to realize a processor like structure.
I have a signed variable (RAM) declared after the systemC syntax
"sc_ufixed<32,32> RAM".
I also have an signed integer in my testbench, "int myIplImage.depth".
If I give this unsigned RAM the value of a signed variable
myIplImage.depth in my testbench,
::RAM[100] = myIplImage.depth;
the bit pattern is transferred.
But when I do it the other way around,
::myIplImage.depth = RAM[100];
to extract my results back to the testbench, the contest is messed up
since the RAM keeps a "bigger" value (since it's unsigned) then what
will fit into the signed variable "myIplImage.depth".
How can I transfer the unsigned value of my RAM back to the signed
variable in my testbench? (I like to do this in a bit wise matter,
just transfer the bit pattern.)
(PS. myIplImage.depth = (signed int)RAM[100] does not work...)
best regards,
Andreas Lundgren
I'm working with systemC to realize a processor like structure.
I have a signed variable (RAM) declared after the systemC syntax
"sc_ufixed<32,32> RAM".
I also have an signed integer in my testbench, "int myIplImage.depth".
If I give this unsigned RAM the value of a signed variable
myIplImage.depth in my testbench,
::RAM[100] = myIplImage.depth;
the bit pattern is transferred.
But when I do it the other way around,
::myIplImage.depth = RAM[100];
to extract my results back to the testbench, the contest is messed up
since the RAM keeps a "bigger" value (since it's unsigned) then what
will fit into the signed variable "myIplImage.depth".
How can I transfer the unsigned value of my RAM back to the signed
variable in my testbench? (I like to do this in a bit wise matter,
just transfer the bit pattern.)
(PS. myIplImage.depth = (signed int)RAM[100] does not work...)
best regards,
Andreas Lundgren