+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 2
    Points: 19, Level: 1

    Join Date
    Apr 2019
    Posts
    2
    Helped
    0 / 0
    Points
    19
    Level
    1

    Altera Cyclone IV Internal Memory - ROM: 1-Port Problem

    Hi,

    I have created a MIF file containing 100 x 16bit values. The values point to a colour palette which contains the RGB values for 10 colours.

    In Quartus Prime Lite I have used the IP Catalogue to create a ROM: 1-Port file

    My top Verilog HDL file references the ROM file which when compiled / simulated on the FPGA development board should produce a 10 coloured stripped square (10 x 10 pixels) on the attached monitor. However, all I get is a blue square.

    Could you please help me with where my code is going wrong. After I compile the design the total memory bits states 4 / 423,936 ( < 1 % ), which I believe is not right for the size of the data I am trying to place in the ROM memory.

    I have attached the files for my design (in .txt format). Please ignore the 640x480 file name references, it should actually be 800x600

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 256,485, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,745
    Helped
    13609 / 13609
    Points
    256,485
    Level
    100

    Re: Altera Cyclone IV Internal Memory - ROM: 1-Port Problem

    The spiterom module isn't referenced because variable address isn't driven in the design. Instead it must be connected to clk.
    Accessing q as an array is also wrong. You get the memory value according to variable address back in variable q.

    You'll notice that ROM value q is delayed relative to address.

    The best way to check the operation of your design step-by-step is to use Modelsim.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Newbie level 2
    Points: 19, Level: 1

    Join Date
    Apr 2019
    Posts
    2
    Helped
    0 / 0
    Points
    19
    Level
    1

    Re: Altera Cyclone IV Internal Memory - ROM: 1-Port Problem

    Many, many thanks for the reply.

    So my code;
    Code dot - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    //---------------
    reg [6:0] address;
    reg clock;
    wire [15:0] q;
     
    Spriterom u1(
        address,
        clock,
        q);
     
    initial clock=0;[/B]
    //--------------

    Is this correct or should I be using "clk" instead of "clock".

    During the
    Code dot - [expand]
    1
    2
    3
    
    H_SCAN > HZSYNC+HBACK_PORCH 
    and 
    V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE+1
    is it possible to read the ROM during this period and output it via "red" , "green" and "blue".

    I understand what you say about q. Would you be able to provide me with some code showing how to do it correctly please.
    Last edited by BradtheRad; 13th April 2019 at 17:34. Reason: Added code formatted window



--[[ ]]--