Byte Write Enable in Block Memory Generator?

Home Forums MIPS Insider MIPSfpga Byte Write Enable in Block Memory Generator?

This topic contains 4 replies, has 2 voices, and was last updated by  ZubairLK 8 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #64438

    Sammy
    Participant

    Hello,
    I’m going through the Vivado projects included in the MIPSfpga SOC bundle and noticed in the Block Memory Generator ‘Byte Write Enable’ is not checked. Is there something in the core that handles individual byte writes? Just curious.

    -Sam

    #64442

    ZubairLK
    Participant

    Hi,

    The BRAM is used for program memory and isn’t written to much (if at all).
    If I remember correctly, it was something to do with addressing of memory.
    There is also a note in the appendix document 6.3 which explains a bit about addressing.

    You could try enabling it and see what happens.
    And/or see if a store byte instruction works with/without.

    Regards,
    ZubairLK

    #64441

    Sammy
    Participant

    Thanks, Zubair. I was just looking at section 6.3 of the appendix.

    When I add in the MIG and DDR, byte writes should be OK?

    #64440

    ZubairLK
    Participant

    Yes they should work.

    Regards,
    ZubairLK

    #64439

    Sammy
    Participant

    I’ve added the MIG and DDR to my design and went ahead and loaded the following test:

    int main() {
        volatile unsigned char buffer[10];
        volatile int i = 0;
    	while(1) {
                buffer[i++] = 0x09;
    	}
    
      return 0;
    }

    I changed the linker script and fpga.h to put code and the stack to 0xa0001000 and 0xa0004000 respectively. When I step through the code, I get the following:

    2: x/12i $pc
    => 0xa000101c <main+28>:	sb	a0,0(v0)
       0xa0001020 <main+32>:	b	0xa000100c <main+12>
       0xa0001024 <main+36>:	nop
    

    As I step through the iterations of the store byte instruction, I get the following for the contents of $v0:

    (gdb) x 0xa0003fd8
    0xa0003fd8:	0x00000009
    …
    (gdb) x  0xa0003fd8
    0xa0003fd8:	0x00000900
    …
    (gdb) x 0xa0003fd8
    0xa0003fd8:	0x00090000

    I was kind of expecting it to fill it with all 0x09s e.g.: 0x09090909
    Is this behavior expected?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.