Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Here; I need an "undergraduate "; --- Quote End --- Sorry: I simply meant that if you do not know how to program in C because your background is electrical engineering / logic design, then I would grab a CS undergraduate to help with the software instead of trying to pick it up on the fly while trying to complete your FPGA IP project. It is different skill set, and this relationship was common when I was in school; many of the larger labs had undergrad CS work-study students hanging around simply to help the graduate students and professors with their experiments / projects that required small programs / scripts. From your other thread where you posted your code, if the only thing you want to accomplish is to avoid writing "alt_u8 array[4][4]" everywhere, you can use typedef and a struct or a union. Here is a union, which is convenient if you need to access the same data either 8 or 32 bits at a time.
typedef union {
alt_u8 u8 ; /** 8-bit access */
alt_u32 u32; /** 32-bit access */
} FOO128;
void main(void)
{
FOO128 x;
FOO128 result;
int i;
/* initialize the data byte-by-byte */
for(i=0; i < 16; i++) {
x.u8 = i;
}
/* write the data to the hardware block 32-bits at a time */
for(i=0; i < 4; i++) {
IOWR(base, i, x.u32);
}
/* read the data from the hardware block 32-bits at a time */
for(i=0; i < 4; i++) {
result.u32 = IORD(base, i);
}
}
On the other hand, if you are trying to construct a software validation of your FPGA IP and want to independently compute the various 128-bit math operations, you should look into getting that code from somewhere else like the wiki article I previously posted. Good luck.