Byte Write Enable in Block Memory Generator?

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

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

    Sammy
    Member

    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

    1 user thanked author for this post.
    #55796

    ZubairLK
    Member

    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

    #55797

    Sammy
    Member

    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?

    1 user thanked author for this post.
    #55802

    ZubairLK
    Member

    Yes they should work.

    Regards,
    ZubairLK

    #56054

    Sammy
    Member

    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?

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.