Results 1 to 5 of 5

Thread: Write a lot of data

  1. #1
    Join Date
    Jan 2009
    Posts
    72
    Rep Power
    1

    Default Write a lot of data

    I'm considering two options.
    The first:
    Code:
    case (address) is
        when X"00500" => byte0 <= data;
        when X"00501" => byte1 <= data;
        when X"00502" => byte2 <= data;
       -- and so on
    end case;
    Th second:
    Code:
    type big_data is array (0 to 1024) of std_logic_vector(7 downto 0);
    signal bytes : big_data;
    
    bytes(address) <= data;
    Which one is faster and consumes less LEs? Considering I have 600 registers to read/write.
    Last edited by john7; February 15th, 2017 at 12:50 AM.

  2. #2
    Join Date
    Sep 2013
    Location
    London
    Posts
    1,404
    Rep Power
    1

    Default Re: Write a lot of data

    Have you tried it? Quartus will tell you.

    If you end up describing the same function, but in two different way, Quartus may well rationalise it out to the same thing.

    I'll pick up on a few inconsistencies in your examples. 'address' appears to be 20-bits wide in your fist example, but is 11-bits wide in the second (or did you meant 0 to 1023?). You also refer to 600 registers. I can't see how that's relevant to either option...

    Cheers,
    Alex

  3. #3
    Join Date
    Jan 2009
    Posts
    72
    Rep Power
    1

    Default Re: Write a lot of data

    address is 16 bit wide. I meant 0-1023 but actually it'll be about 700 registers.
    I suppose the second option faster (it's RAM implementation) but then I should allocate 700 16-bit registers. Waste of memory. Not all of my variables 16-bit wide. In the first option i could write (considering data is 16-bit wide)
    Code:
    case (address) is
        when X"00500" => byte <= data;
        when X"00501" => bit <= data(0);
        when X"00502" => word <= data;
     end case;
    I use MAX10. For now I have enough LEs. So my main concern is a speed.
    Last edited by john7; February 15th, 2017 at 01:14 AM.

  4. #4
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,695
    Rep Power
    1

    Default Re: Write a lot of data

    The second example will infer a ram if the code behaves correcly. I dont know if the first example can infer a ram as byte0/1 etc are separate signals.
    Why not try them and see the results?

  5. #5
    Join Date
    Jan 2009
    Posts
    72
    Rep Power
    1

    Default Re: Write a lot of data

    I see. I'll try.

Similar Threads

  1. connection problem with qdr..how to write data on qdr.?
    By crazybuddy in forum General Altera Discussion
    Replies: 0
    Last Post: January 2nd, 2017, 02:18 AM
  2. write some data to lcd
    By G.Ornil in forum OpenCL
    Replies: 1
    Last Post: October 3rd, 2016, 08:09 AM
  3. write data with IOWR();
    By Luiggi in forum General Altera Discussion
    Replies: 0
    Last Post: January 6th, 2015, 04:22 AM
  4. Read write data in max ii ufm
    By neematrol in forum Quartus II and EDA Tools Discussion
    Replies: 8
    Last Post: April 11th, 2014, 07:33 AM
  5. Replies: 0
    Last Post: December 9th, 2013, 06:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •