electronics forum

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

vhdl: three branch process question


Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> vhdl: three branch process question
Author Message
pini_1



Joined: 18 Jun 2007
Posts: 288
Helped: 17


Post28 Oct 2009 13:37   

vhdl: three branch process question


I wrote behavioral model for a SRAM device. The model is based on sparse memory, which I found on doulos site. I changed the read drive and write store logic to fit my asynchronous memory.
When I simulated with GHDL, I encounter a problem. Sometimes GHDL would not drive the read data bus, even though that a print message one line before drive verifies that it should.
With a little change to the code style, GHDL works okay. The change is merely:
canceling the positive edge detection to regular logic.
Please comment on this issue. Is it a VHDL typo or a GHDL bug.

The problemtic code follows and the entire code is at:
http://bknpk.no-ip.biz/my_web/IP_STACK/sram_sparse_vhdl.html

process (lcen, loen, lwen, laddr)

begin
if(lcen = '0' and lwen = '1' and loen ='0') then --read
Get(laddr, D);
ldata <= D;--sometimes does not work ??
end if;

--stop driving the data
if loen'EVENT and loen = '1' then
ldata <= (others => 'Z');
end if;

--The next line offended GHDL please comment .
--if lwen'EVENT and lwen = '1' then
if lwen = '0' then
if(lcen = '0') then --write

Set (laddr, ldata);
end if;
end if;
Back to top
avimit



Joined: 16 Nov 2005
Posts: 417
Helped: 69
Location: Fleet, UK


Post28 Oct 2009 14:35   

Re: vhdl: three branch process question


Try one thing.
Instead of using
if loen'EVENT and loen = '1' then
use
if(rising_edge(loen)) then

and let me know
Avi
http://www.vlsiip.com
Back to top
pini_1



Joined: 18 Jun 2007
Posts: 288
Helped: 17


Post28 Oct 2009 15:42   

Re: vhdl: three branch process question


No it did solve the issue. In my opinion GHDL implements both in the same way.
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5161
Helped: 767
Location: Bochum, Germany


Post28 Oct 2009 16:13   

Re: vhdl: three branch process question


Quote:
In my opinion GHDL implements both in the same way.
No surprize, because the two expressions are exactly synonymous.

There is a rather confusing mix of edge sensitive and level sensitive statements. I doubt, if this can be a suitable behavioral description of the device. It's completely unsynthesizable anyway. In my opinion, a SRAM won't need edge sensitive conditions, possibly except for the write to storage cells action. The control of
data buffer enables must be surely level sensitive.
Back to top
pini_1



Joined: 18 Jun 2007
Posts: 288
Helped: 17


Post28 Oct 2009 16:18   

Re: vhdl: three branch process question


I said that the RAM is behavioral model for simulation, so synthesis is not an issue.
Back to top
Google
AdSense
Google Adsense




Post28 Oct 2009 16:18   

Ads




Back to top
aliputa



Joined: 01 Nov 2009
Posts: 3
Location: China


Post01 Nov 2009 17:00   

Re: vhdl: three branch process question


hello, i think you maybe should check the SRAM's code clearly, 1. it's a synchronous SRAM or an asynchronous SRAM? 2. your code(writed by yourself) is a synchronous or an asynchronous?
and some type of SRAM need a pulse wave for WRITE(or READ) in every operation period.
i think the code which writed by yourself should adapt the SRAM's code, maybe there is something not so match between two codes.

it's just my opinion
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 -> ASIC Design Methodologies & Tools (Digital) -> vhdl: three branch process question
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
VHDL question (process implementation as FSM) (1)
I branch and Q branch in a dual conversion radio (2)
question about 90deg branch line coupler again (7)
Delay counters in three process state machines (4)
question about LO leak and LO+2*IF leak in a transmit branch (4)
Questions About VHDL process (6)
amount of parallel process in vhdl (1)
Resetting Signals in VHDL Combinational Process (5)
VHDL question? Data position in VHDL? Let's see some answers (1)
How to halt simulation process automatically in VHDL (5)


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