UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor 463717263
Visitor
7,736 Views
Registered: ‎12-16-2013

The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

hi

would you tell me what's wrong in my project.

always @(negedge clk or negedge rst)
begin
begin
if (!rst)
sram_sel <= 0;
end
begin
if (we0 == 0 && addr0_wr == 19'd512)
begin
sram_sel <= ~sram_sel;
end
if (we1 == 0 && addr1_wr == 19'd512)
begin
sram_sel <= ~sram_sel;
end
end
end

 

cheers

 

micheal

0 Kudos
1 Solution

Accepted Solutions
Teacher eteam00
Teacher
10,024 Views
Registered: ‎07-21-2009

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

Try this.

 

always @(negedge clk or negedge rst)
begin
    if (!rst)    sram_sel <= 0;
    else  // <-- missing from original code
        begin
            if (we0 == 0 && addr0_wr == 19'd512)    sram_sel <= ~sram_sel;
            if (we1 == 0 && addr1_wr == 19'd512)    sram_sel <= ~sram_sel;
        end
end

 

If you are selecting a register or sram based on a we pulse, your logic is in error.  A more typical decoding of we and address inputs is:

 

always @(negedge clk or negedge rst)
begin
    if (!rst) sram_sel <= 0;
    else              sram_sel <= ( (we0 == 0) || (we1 == 0) ) && ( addr0_wr == 19'd512 );
end

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.

View solution in original post

0 Kudos
10 Replies
Moderator
Moderator
7,731 Views
Registered: ‎06-05-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
Hi,
In you always block,reset if level triggered & clock is edge triggered signal. Mixing of both is is not recommended.

Thanks
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Xilinx Employee
Xilinx Employee
7,720 Views
Registered: ‎09-20-2012

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

Hi Micheal,

 

Try the below code, it works

 

always @(negedge clk or negedge rst)
begin

if (!rst)
begin
sram_sel <= 0;
end
else if (we0 == 0 && addr0_wr == 19'd512)
begin
sram_sel <= ~sram_sel;
end
else if (we1 == 0 && addr1_wr == 19'd512)
begin
sram_sel <= ~sram_sel;
end
end

 

Thanks,

Deepika.

 

Thanks,
Deepika.
--------------------------------------------------------------------------------------------
Google your question before posting. If someone's post answers your question, mark the post as answer with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left)
0 Kudos
Scholar pratham
Scholar
7,715 Views
Registered: ‎06-05-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

Hello,

Every time you were closing the if statement without the else if or else statement So obvoulsy this template was not matching with the known flip flop or latch template.

Add else if and put the conditions of your codes,

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Teacher eteam00
Teacher
7,696 Views
Registered: ‎07-21-2009

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

har**bleep** wrote:

In you always block,reset if level triggered & clock is edge triggered signal. Mixing of both is is not recommended.

 

This is incorrect.  The edge sensitivity for both clock and async reset is the proper syntax.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Teacher eteam00
Teacher
10,025 Views
Registered: ‎07-21-2009

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution

Try this.

 

always @(negedge clk or negedge rst)
begin
    if (!rst)    sram_sel <= 0;
    else  // <-- missing from original code
        begin
            if (we0 == 0 && addr0_wr == 19'd512)    sram_sel <= ~sram_sel;
            if (we1 == 0 && addr1_wr == 19'd512)    sram_sel <= ~sram_sel;
        end
end

 

If you are selecting a register or sram based on a we pulse, your logic is in error.  A more typical decoding of we and address inputs is:

 

always @(negedge clk or negedge rst)
begin
    if (!rst) sram_sel <= 0;
    else              sram_sel <= ( (we0 == 0) || (we1 == 0) ) && ( addr0_wr == 19'd512 );
end

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.

View solution in original post

0 Kudos
Visitor 463717263
Visitor
7,672 Views
Registered: ‎12-16-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
 
0 Kudos
Visitor 463717263
Visitor
7,672 Views
Registered: ‎12-16-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
Thank you very much~deepika~
0 Kudos
Visitor 463717263
Visitor
7,672 Views
Registered: ‎12-16-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
Thank you very much~pretham~
0 Kudos
Visitor 463717263
Visitor
7,672 Views
Registered: ‎12-16-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
Thank you very much Bob~
0 Kudos
Highlighted
Visitor 463717263
Visitor
2,131 Views
Registered: ‎12-16-2013

Re: The logic for <sram_sel> does not match a known FF or Latch template.

Jump to solution
Thank you very much~ The problem has been solved~
0 Kudos