electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

when will the wr_almost_full be set to "1" in this


Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> when will the wr_almost_full be set to "1" in this
Author Message
kimjin



Joined: 06 Mar 2005
Posts: 62


Post14 Dec 2008 13:31   

when will the wr_almost_full be set to "1" in this


always @(posedge clk_wr or negedge rst_n)
if (~rst_n)
wr_almost_full <= 1'b0;
else if (reset_fifo_wr)
wr_almost_full <= 1'b0;
else if (wr)
begin
// set full bit a bit early to allow for the fact that the master
// will sample it whilst data is still streaming back on Avalon
if (wr_used > ({WR_PTR_WIDTH{1'b1}} - 8 ) - (1 << (WRITE_ALMOST_BIT - 1)))
wr_almost_full <= 1'b1;
end
else if (wr_almost_full)
begin
if (wr_used > ({WR_PTR_WIDTH{1'b1}} - 8 ) - (1 << (WRITE_ALMOST_BIT - 1)))
wr_almost_full <= 1'b1;
else
wr_almost_full <= 1'b0;
end

WR_PTR_WIDTH=7
WRITE_ALMOST_BIT =6
i think the wr_almost_full will set when wr_used >110,
but it set when wr_used >96,
why it's 96 but not 110, any suggestion is welcome.
Back to top
Google
AdSense
Google Adsense




Post14 Dec 2008 13:31   

Ads




Back to top
j_andr



Joined: 30 Mar 2008
Posts: 107
Helped: 20
Location: europe


Post15 Dec 2008 17:16   

Re: when will the wr_almost_full be set to "1" in


I've done such simple test code:
Code:

module shift_test
(
   input             clk,
   output  reg [6:0] tmpA, tmpB,
   output  reg [6:0] wr_used
);

parameter  WR_PTR_WIDTH = 7,
           WRITE_ALMOST_BIT = 6;

always @(posedge clk)
  begin
     tmpA    <= ({WR_PTR_WIDTH{1'b1}} - 8 );
     tmpB    <= (1 << (WRITE_ALMOST_BIT - 1));
     wr_used <= ({WR_PTR_WIDTH{1'b1}} - 8 ) - (1 << (WRITE_ALMOST_BIT - 1));
  end
endmodule


after compilations I got such - as expected - numbers:
tmpA = [dec] 119, 1110111
tmpB = 32, 100000
wr_used = 87; 1010111
---
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> when will the wr_almost_full be set to "1" in this
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
What is the need of "FLUX" when soldering on PCB? (26)
How to improve the "Pi-pa" noise when make a call (3)
Is the mean "Class AB" & "Push pull" (6)
where the termiinal "DN" and "SUB" conne (2)
Does the "network on chip" belongs to this forum? (1)
Consider a 2:1 mux , what will output if sel is"x" (13)
What is the component "SMN2" , "SMP2" an (2)
SiGe - Will it "kill" InP, GaAs ? (5)
How to set a voice modem to detect "NO ANSWER"? (1)
How to set variables in "vpulse" in spectre ADE en (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS