+ Post New Thread
Results 1 to 11 of 11
  1. #1
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Initializing Xilinx BRAM with image pixels

    Hi,

    I would like to initialize Xilinx BRAM (ROM) with image pixels, any ideas ?

    cheers,

    •   Alt6th November 2017, 20:52

      advertising

        
       

  2. #2
    Super Moderator
    Points: 27,672, Level: 40
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,318
    Helped
    1533 / 1533
    Points
    27,672
    Level
    40

    Re: Initializing Xilinx BRAM with image pixels

    Maybe you should read the Xilinx documentation, it states clearly how to initialize the content of a ROM using the block memory generator. Look for PG058.

    If I read it and then post the relevant information, it just means next time you won't read the documentation and will keep posting questions clearly answered in the documentation.

    You know Xilinx includes a program called Xilinx Documentation Navigator (installed by default), which makes it really really easy to search all their documentation for stuff you may have questions about.



  3. #3
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Re: Initializing Xilinx BRAM with image pixels

    Thank you for your help, but please next time don't lecture me.



    •   Alt7th November 2017, 11:03

      advertising

        
       

  4. #4
    Advanced Member level 5
    Points: 34,868, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,388
    Helped
    1861 / 1861
    Points
    34,868
    Level
    45

    Re: Initializing Xilinx BRAM with image pixels

    Quote Originally Posted by Taki_comp View Post
    Thank you for your help, but please next time don't lecture me.
    If you dont want a lecture, then please research properly before posting here.



    •   Alt7th November 2017, 12:02

      advertising

        
       

  5. #5
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Re: Initializing Xilinx BRAM with image pixels

    My question here: is there anyway to convert an image file into coe file ?



  6. #6
    Member level 3
    Points: 429, Level: 4

    Join Date
    Apr 2017
    Posts
    67
    Helped
    12 / 12
    Points
    429
    Level
    4

    Re: Initializing Xilinx BRAM with image pixels

    Quote Originally Posted by Taki_comp View Post
    My question here: is there anyway to convert an image file into coe file ?
    Yes it is. You have to write a program in your favorite language for converting bitmap into coe file. I did one for png to mif conversion.



  7. #7
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Re: Initializing Xilinx BRAM with image pixels

    Let's say I use matlab, how can I do that ?



  8. #8
    Member level 3
    Points: 429, Level: 4

    Join Date
    Apr 2017
    Posts
    67
    Helped
    12 / 12
    Points
    429
    Level
    4

    Re: Initializing Xilinx BRAM with image pixels

    Quote Originally Posted by Taki_comp View Post
    Let's say I use matlab, how can I do that ?
    Just write a proper script in matlab:
    1) read a bitmap into array: https://uk.mathworks.com/help/matlab/ref/imread.html
    2) do a colour conversion from RGB to RGB565 or any other desirable format
    3) write to disk a text file in coe format.



    •   Alt8th November 2017, 16:22

      advertising

        
       

  9. #9
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Re: Initializing Xilinx BRAM with image pixels

    I already did the first two steps, for the last step I tried to display the values of the matrix in the command window but I can only display correctly few rows at a time correctly,I was wondering what may cause this problem ?



  10. #10
    Full Member level 3
    Points: 2,428, Level: 11
    Achievements:
    7 years registered

    Join Date
    Nov 2009
    Location
    Pakistan
    Posts
    183
    Helped
    18 / 18
    Points
    2,428
    Level
    11

    Re: Initializing Xilinx BRAM with image pixels

    use .coe file to initialize your memory ROM at startup



  11. #11
    Member level 1
    Points: 899, Level: 6

    Join Date
    Dec 2013
    Posts
    36
    Helped
    0 / 0
    Points
    899
    Level
    6

    Re: Initializing Xilinx BRAM with image pixels

    Thank you all for you replies, I solved the problem



--[[ ]]--