OpenCores
URL https://opencores.org/ocsvn/s6soc/s6soc/trunk

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [bench/] [cpp/] [qspiflashsim.cpp] - Diff between revs 10 and 17

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 10 Rev 17
Line 104... Line 104...
        }
        }
}
}
 
 
void    QSPIFLASHSIM::write(const unsigned addr, const unsigned len, const uint32_t *buf) {
void    QSPIFLASHSIM::write(const unsigned addr, const unsigned len, const uint32_t *buf) {
        char    *ptr;
        char    *ptr;
 
        if ((addr+len < SPIFLASH)||(addr >= SPIFLASH+MEMBYTES/4))
 
                return;
        printf("FLASH: Copying into memory at S6Add4 %08x, my addr %08x, %d values\n",
        printf("FLASH: Copying into memory at S6Add4 %08x, my addr %08x, %d values\n",
                addr, (addr-SPIFLASH)<<2, len<<2);
                addr, (addr-SPIFLASH)<<2, len<<2);
        ptr = &m_mem[(addr-SPIFLASH)<<2];
        ptr = &m_mem[(addr-SPIFLASH)<<2];
        memcpy(ptr, buf, len<<2);
        memcpy(ptr, buf, len<<2);
        printf("%02x %02x %02x %02x\n", ptr[0]&0x0ff, ptr[1]&0x0ff, ptr[2]&0x0ff, ptr[3]&0x0ff);
        printf("%02x %02x %02x %02x\n", ptr[0]&0x0ff, ptr[1]&0x0ff, ptr[2]&0x0ff, ptr[3]&0x0ff);

powered by: WebSVN 2.1.0

© copyright 1999-2023 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.