Thread: [myhdl-list] No proper edge value test
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2012-07-18 03:05:02
|
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. Regards, Chris |
From: Jan D. <ja...@ja...> - 2012-07-18 11:24:48
|
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.) -- 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 |
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 |
From: Christopher F. <chr...@gm...> - 2012-07-18 12:20:59
|
On 7/18/2012 6:24 AM, Jan Decaluwe wrote: > 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.) > Ahh, I didn't describe the observed issue correctly. It is the difference between toVerilog and toVHDL. Not a difference between revisions, toVerilog will accept the above toVHDL will error. And both will accept ... if reset ... In the past I had only used toVerilog and when I added a toVHDL, I mistakenly thought it might have been a change in behavior due to recent changes. Regards, Chris |