Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

how to model registers

$
0
0

Hi, I have an assignment in which I should model an adc. This adc has some 32 bit registers that must be accessed from a header file in order to write or read data from the adc. I have tried doing this by using a pointer, but I get a segmentation fault when accessing it in my program. I know that it is not possible to have custom address in c++ that you can write to. In this case, how it is possible to model such register in systemC?

 

for example in registers.h I have the following

#define control_register 0x40038000

 

 

and I try to write in some function of a systemc module

*((int *) control_register) = 2;

 

So, obviously I get the segmentation fault

 


Viewing all articles
Browse latest Browse all 595

Trending Articles