When Andes ISA "lmw/smw" execute on axi-bus, axi-bus will send burst-8 words. 8 words alignment may cause problem when reach IO peripheral. There are no 8 words alignment problem if executing basic load/store instruction on axi-bus. for eample, C code: u64_t mem_value64; mem_value64 = MEM64(0x10040000);
compiler will translate C code to assembly code assembly: cd0: 46 01 00 40 sethi $r0,#0x10040 cd4: 3a 00 04 00 lmw.bi $r0,[$r0],$r1,#0x0 ! {$r0~$r1} cd8: f0 86 swi37.sp $r0,[+#0x18]
above assembly code will send burst-8 words on axi-bus. if we want to send 2 words on axi bus, replacement C program is as follows.
#define LOAD_MEM64(val, addr) \ val = *(unsigned long volatile*)(addr), \ val |= (((unsigned long long)*(unsigned long volatile*)(((unsigned)addr) + 4)) << 32)
#define STORE_MEM64(val, addr) \ *(unsigned long volatile*)(addr) = (unsigned)val, \ *(unsigned long volatile*)(((unsigned)addr) + 4) = (unsigned)(val >> 32)
|