Re: [myhdl-list] No proper edge value test
Brought to you by:
jandecaluwe
From: Oscar D. <osc...@gm...> - 2012-07-18 11:30:46
|
2012/7/18 Jan Decaluwe <ja...@ja...>: > On 07/18/2012 05:05 AM, Christopher Felton wrote: >> With the latest 0.8dev code the following will cause >> a "No proper edge value test" >> >> def testm(clock, reset, out): >> @always(clock.posedge, reset.negedge) >> def hdl(): >> if not reset: >> out.next = 0 >> else: >> out.next = out ^ 0x55 >> >> return hdl >> >> def convert(): >> clock = Signal(False) >> reset = Signal(False) >> out = Signal(intbv(0)[8:]) >> toVerilog(testm, clock, reset, out) >> toVHDL(testm, clock, reset, out) >> >> >> Is this expected behavior? This could possibly break >> existing code. > > Don't think so - same in 0.7. > > Yes, I would call it expected behavior. A reset should > check on a value - giving it a logical interpretation > can only lead to confusion. (As here, where 'not reset' > checks for an active reset.) I also checked it (both in 0.7 and 0.8dev). I noticed that it only fails for VHDL conversion (Verilog works fine). Changing the condition to "reset == 0" or "reset == False" solves the problem. > > -- > Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com > Python as a HDL: http://www.myhdl.org > VHDL development, the modern way: http://www.sigasi.com > World-class digital design: http://www.easics.com > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list -- Oscar Díaz Key Fingerprint = 904B 306C C3C2 7487 650B BFAC EDA2 B702 90E9 9964 gpg --keyserver subkeys.pgp.net --recv-keys 90E99964 I recommend using OpenDocument Format for daily use and exchange of documents. http://www.fsf.org/campaigns/opendocument |