Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Can I create VHDL-defined Dual-Port Dual-Clock ROMs with QuartusII 9.1 for Cyclone II

I have made an NCO which reads ROM memory. I have tried to make it a Dual-Port Dual-Clock ROM to be able to meet the timing, it works fine, however it is synthesized by duplicating the memory, 2 Single-Port ROMs rather than what I had planned. The main reason I require the Dual-Port Dual-Clock ROM is to use the specified ammount of memory blocks, it's using twices the ammout reported (it also creates 2 identical mif files).

The design is based on the "Dual-Port ROM" modified slightly with the "True Dual-Port RAM (dual-clock)" placed in "Insert Template->VHDL->Full Designs->RAMs and ROMs" path.

There is currently no information I could find on how to ensure the ROM is recognised with dual-clocks, all information refers to single-clock dual-ROM.

I also tried to check the MegaWizard to see what it allows, however when I chose "Installed Plug-Ins->Memory Compliler->ROM: 2-PORT", when I click the "Clks/Rd, Byte En" Tab, the file crashes, "mega_lpm_ram has encountered a problem and needs to close". I reloaded Quartus completely and also check my computer at work (Win-7), and the same thing happens. (If that happens to others, it may require a seperate thread)

My system is

Windows XP (Windows 7 at work).

Quartus II Version 9.1 Build 222 10/21/2009 SJ Web Edition.

Cyclone II EP2C20F484C7.

If anyone has information that can solve this, thank you in advance.

David K.

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    The design is based on the "Dual-Port ROM" modified slightly with the "True Dual-Port RAM (dual-clock)" placed in "Insert Template->VHDL->Full Designs->RAMs and ROMs" path.

    --- Quote End ---

    Why? The NCO design should work fine with the original dual-port ROM template.

    Without setting additional parameters, a true dual-clock RAM design will use double the RAM amount on Cyclone II to be compatible with revision A chips.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The reason I need to use Dual-Clock ROM is because of the speed. The main clock is 280MHz, which the memory won't pass the timing requirements (163MHz max), so the clock divided in half to make two 140MHz clocks, one inverted, to read the Dual-Port ROM. One port is read on positive clock and the other port on the inverted clock at 140MHz, effectively reading the ROM at 280MHz. Afterwards the two streams interleave to reassemble the single stream for the NCO output. The answer, a single clock is not sufficient.

    It works fine, I have my own FM radio station (for about 20 meters), however it costs twice the ROM memory, as you said. Perhaps the cause is attributed to the additional parameters you mentioned (that I haven't set yet), the design of the ROM doesn't seem that complicated. If you can let me know where the information on where the additional parameters are, I will see if that solves the issue.

    David K.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Couldn't you just read both samples on the same 140MHz clock and delay one until the next edge of the 280MHz clock?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Two comments:

    1. I don't see why you need dual clock. You can use a singe clock and delay one stream by a half clock cycle.

    2. True dual port works with Cyclone II without doubling memory utilization if parameter CYCLONEII_SAFE_WRITE is set to VERIFIED_SAFE. Refer to the CII errata sheet for details.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Two comments:

    1. I don't see why you need dual clock. You can use a singe clock and delay one stream by a half clock cycle.

    2. True dual port works with Cyclone II without doubling memory utilization if parameter CYCLONEII_SAFE_WRITE is set to VERIFIED_SAFE. Refer to the CII errata sheet for details.

    --- Quote End ---

    I don't see how delay of slow data(at 140) will work at required rate of 280. I think you can read a rom of double width getting two samples at a 140 rate then serialise it in the fast 280 domain.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I don't see how delay of slow data(at 140) will work at required rate of 280.

    --- Quote End ---

    Use a simple (single clock) dual port ROM.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That's an interesting sugestion, I never thought of that one before. Remember that the delay function is also required for one of the address ports to sync with the 140MHz, since the address are sequentially generated with a 280MHz adder/counter.

    However, the second reason I want to make a dual-clock ROM for the NCO is because I have to make serveral more NCO's for the processing path. My idea was to make a generic NCO which can be used by two seperate section , providing of course the WIDTH and LENGTH are the same, regardless of which clock or clock_enable used, to make the best use of memory space.

    I checked out the Cyclone II Errata, and it claims ROM requires None for Quartus Action. Then I tried other Cyclone versions, and my NCO didn't optimize the memory, however using the ROM Dual-Port template with antother clock and another read process, and it DID perform the memory optimization!

    There were a few things that cause it to creat double memory blocks...

    -Using the WORD_T as an INTEGER rather than a STD_LOGIC_VECTOR.

    -Using ROM : MEMORY_T as a CONSTANT rather than a SIGNAL.

    -Adding a CLOCK_EN to either or both clocks.

    Note, some of these affect single-clock as well.

    The integer is convenient but the STD_LOGIC_VECTOR is pretty much the same data and (except for this exception) usually generates the same hardware PORT or SIGNAL.

    I used a CONSTANT because a SIGNAL created 'Warning (10540): ... used explicit default value for signal "memory_data" because signal was never assigned a value', although using the correct design also removes the warning.

    "Cyclone II M4K memory blocks support address clock enables,...", however I haven't been able to add a CLOCK_EN, or dual-clock with two of them, and maintain the memory optimization. Quite frequently, if possible, I use the same clock and use seperate clock enables for different timing, so effective I solved my initial question, however I have added the "...With CLOCK_ENABLES..." to my initial question.

    Any Sugestions?

    David K.