Thread: [myhdl-list] simulation coding vs conversion coding
Brought to you by:
jandecaluwe
From: <L...@rs...> - 2014-03-08 10:12:16
|
Hi, when using list of signals with signal slicing, I need to change coding between simulation and conversion. Please see the comment in def ab(in1,out1). Has this already been discussed somewhere? Regards Lars from myhdl import * def ab(in1,out1): one=[Signal(intbv(0)[2:]) for k in range(2)] @always_comb def comb1(): one[0].next[0]=in1 #conv_run requires: one[0][0].next=in1 @always_comb def comb2(): out1.next=one[0][0] return instances() def sim_dut(): in1,out1=[Signal(intbv(0)[2:]) for k in range(2)] dut=ab(in1,out1) @instance def stimulus(): for k in range(2): in1.next=k yield delay(5) print out1 raise StopSimulation return instances() def sim_run(): tb_inst=sim_dut() sim=Simulation(tb_inst) sim.run() def conv_run(): in1,out1=[Signal(intbv(0)[2:]) for k in range(2)] dd=toVHDL(ab,in1,out1) |
From: Christopher F. <chr...@gm...> - 2014-03-10 23:56:49
|
On 3/8/14 3:58 AM, L...@rs... wrote: > Hi, > > when using list of signals with signal slicing, I need to change > coding between simulation and conversion. > Please see the comment in def ab(in1,out1). Has this already been > discussed somewhere? Which version of MyHDL are you using? I have not run into this but I don't think I have used the same as you outlined. Regards, Chris |
From: Marcel H. <1he...@in...> - 2014-03-11 06:59:28
Attachments:
signature.asc
|
Hi Lars, > one=[Signal(intbv(0)[2:]) for k in range(2)] do this instead: > one, two = [Signal(intbv(0)[2:]) for k in range(2)] it should avoid your problem. Greetings |
From: Christopher F. <chr...@gm...> - 2014-03-11 11:14:05
|
On 3/11/14 1:59 AM, Marcel Hellwig wrote: > Hi Lars, >> one=[Signal(intbv(0)[2:]) for k in range(2)] > do this instead: > >> one, two = [Signal(intbv(0)[2:]) for k in range(2)] > > it should avoid your problem. > I believe Lars is trying to use a list of signals, the above won't work. You can use list of signals to model memory or other logical structures. http://www.myhdl.org/doc/current/manual/conversion_examples.html?highlight=list%20signals#ram-inference What was posted is the correct approach to bit slice into the individual intbv in the list. one[n].next[b] = in | | | +- intbv bit index +--------- list index Regards, Chris |
From: Keerthan jai.c <jck...@gm...> - 2014-03-12 21:25:33
|
Chris, can you confirm whether this works for you? This does not work for me with 0.8 or 0.9dev upstream. The code I tried is here: https://gist.github.com/9516513 I ran into this problem a few months ago, and implemented a fix for verilog in this commit: https://bitbucket.org/jck2/myhdl/commits/68d86530af4e8a7cd9fb9ca0102a97ebbb93bbb9?at=sf-hotfixes I have not sent a PR yet since I didn't investigate this properly. Lars, you could try making this change to _toVHDL.py and see if it works. On Tue, Mar 11, 2014 at 7:13 AM, Christopher Felton <chr...@gm...>wrote: > On 3/11/14 1:59 AM, Marcel Hellwig wrote: > > Hi Lars, > >> one=[Signal(intbv(0)[2:]) for k in range(2)] > > do this instead: > > > >> one, two = [Signal(intbv(0)[2:]) for k in range(2)] > > > > it should avoid your problem. > > > > I believe Lars is trying to use a list of signals, the > above won't work. You can use list of signals to model > memory or other logical structures. > > > http://www.myhdl.org/doc/current/manual/conversion_examples.html?highlight=list%20signals#ram-inference > > What was posted is the correct approach to bit slice > into the individual intbv in the list. > > one[n].next[b] = in > | | > | +- intbv bit index > +--------- list index > > Regards, > Chris > > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- have a nice day -jck |
From: Christopher F. <chr...@gm...> - 2014-03-12 23:46:26
|
On 3/12/14 4:25 PM, Keerthan jai.c wrote: > Chris, can you confirm whether this works for you? > This does not work for me with 0.8 or 0.9dev upstream. > > The code I tried is here: > https://gist.github.com/9516513 > > I ran into this problem a few months ago, and implemented a fix for > verilog in this commit: > https://bitbucket.org/jck2/myhdl/commits/68d86530af4e8a7cd9fb9ca0102a97ebbb93bbb9?at=sf-hotfixes > I have not sent a PR yet since I didn't investigate this properly. > Yes, I observe the error with 0.8.1 and 0.9dev. I don't recall if this is a known limitation or error? This is a valid work around though: def ab(in1,out1): one=[Signal(intbv(0)[2:]) for k in range(2)] item = Signal(in1.val) @always_comb def comb1(): item = one[0] item.next[0] = in1 always_comb def comb2(): one[0].next = item @always_comb def comb3(): out1.next=one[0][0] return instances() Regards, Chris |
From: Keerthan jai.c <jck...@gm...> - 2014-04-30 16:35:44
|
Awesome, should I submit a bug report/pull request? On Mon, Apr 28, 2014 at 5:29 PM, Lars <L...@rs...> wrote: > > > > <at> Keerthan: > > Thanks. I will try and post the result. > > > > yes, works with _toVHDL. > > thx, > Lars > > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- have a nice day -jck |
From: Christopher F. <chr...@gm...> - 2014-05-01 14:15:06
|
On 4/30/2014 11:35 AM, Keerthan jai.c wrote: > Awesome, should I submit a bug report/pull request? > My opinion yes, but it is not clear if this is a bug against the trunk or a feature/fix for 0.9. I would create a PR towards 0.9. It will provide the opportunity for more testing. Regards, Chris |
From: Lars <L...@rs...> - 2014-04-25 14:10:15
|
Sorry for the long delay. Unfortunately I had no time for this the last weeks. Thank you for looking into the issue so far. I am using version 0.8. @Chris: This is not an option for me. I am already working around 3D and 4D (which is not an issue for VHDL) as well as slices and have dozens of of such signals. Slices issue: abc=slice(...,...) <- use abc in myhdl @Keerthan: Thanks. I will try and post the result. Regards, Lars |
From: Lars <L...@rs...> - 2014-04-28 21:29:43
|
> > <at> Keerthan: > Thanks. I will try and post the result. > yes, works with _toVHDL. thx, Lars |