I'm having trouble using the hash unit. Here is my code : typedef struct hash_t { unsigned int lo; unsigned int hi; } hash_t; hash_t in; hash_t out; in.lo = 0x50; in.hi = 0x20; hash_64((__declspec(sram_read_reg) void *)&in,(__declspec(sram_write_reg) void *)&out,1,ctx_swap); The problem is that no matter what value I assign to the data to be hashed, the output hash is always 0. It turns out that the data to be hashed remains 0 despite being assigned a non-zero value in code. I reckon the compiler puts the hash structures in SRAM (commenting out call to hash_64() results in data to be hashed being assigned the expected non-zero values). This might have something to do with taking address of the hash structures in function call (if address of variable is needed compiler puts variable in SRAM??). I've heard something about the hash multiplier being 0 by default. Could this be affecting the output hash?? Any help greatly appreciated.Also if anybody has written code involving the hash unit please send it to me.... Regards, Simon.
participants (1)
-
Simon.O'Sullivan