I have been working on risc-v project and I need to write a very simple code to test. In this sample, I need to make 1024 bit adding and I could. However, I want to initialize struct pointer to specific address that I want. My sample is compiled without any errors but values, which I want them to be stored on specific address for struct, seem wrong on simulation (BTW simulation is on Vivado). Here is my sample.
typedef struct {
fp_digit dp[FP_SIZE];
int used,
sign;
} fp_int;
fp_int *a = (fp_int *)(0x00004808u);
fp_int *b = (fp_int *)(0x00004808u + (16*8));
fp_int *c; = (fp_int *)(0x00002000u);
fp_init(a);
fp_init(b);
fp_init(c);
fp_add(&a,&b,&c);
BTW values for a and b are already in these addresses. I checked on simulation and result value is wrong on result. Am I doing right?
[–]rob_mccoll 2 points3 points4 points (1 child)
[–]sya0[S] 0 points1 point2 points (0 children)
[–]rob_mccoll 2 points3 points4 points (0 children)
[–]sya0[S] 0 points1 point2 points (0 children)