myhdl-list Mailing List for MyHDL (Page 141)
Brought to you by:
jandecaluwe
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(14) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(1) |
Feb
(10) |
Mar
(19) |
Apr
(14) |
May
(1) |
Jun
(4) |
Jul
(10) |
Aug
|
Sep
(2) |
Oct
(7) |
Nov
(17) |
Dec
(12) |
2005 |
Jan
(6) |
Feb
(10) |
Mar
(17) |
Apr
(10) |
May
(9) |
Jun
(5) |
Jul
(26) |
Aug
(34) |
Sep
(10) |
Oct
(38) |
Nov
(71) |
Dec
(74) |
2006 |
Jan
(20) |
Feb
(20) |
Mar
(7) |
Apr
(2) |
May
(13) |
Jun
|
Jul
|
Aug
(4) |
Sep
(37) |
Oct
(43) |
Nov
(30) |
Dec
(33) |
2007 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(30) |
Jun
(9) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(13) |
Nov
|
Dec
(4) |
2008 |
Jan
(13) |
Feb
(46) |
Mar
(25) |
Apr
(7) |
May
(20) |
Jun
(73) |
Jul
(38) |
Aug
(47) |
Sep
(24) |
Oct
(18) |
Nov
(9) |
Dec
(36) |
2009 |
Jan
(31) |
Feb
(24) |
Mar
(73) |
Apr
(13) |
May
(47) |
Jun
(28) |
Jul
(36) |
Aug
(2) |
Sep
(5) |
Oct
(8) |
Nov
(16) |
Dec
(29) |
2010 |
Jan
(34) |
Feb
(18) |
Mar
(18) |
Apr
(5) |
May
|
Jun
(24) |
Jul
(53) |
Aug
(3) |
Sep
(18) |
Oct
(33) |
Nov
(19) |
Dec
(15) |
2011 |
Jan
(9) |
Feb
(4) |
Mar
(39) |
Apr
(213) |
May
(86) |
Jun
(46) |
Jul
(22) |
Aug
(11) |
Sep
(78) |
Oct
(59) |
Nov
(38) |
Dec
(24) |
2012 |
Jan
(9) |
Feb
(22) |
Mar
(89) |
Apr
(55) |
May
(222) |
Jun
(86) |
Jul
(57) |
Aug
(32) |
Sep
(49) |
Oct
(69) |
Nov
(12) |
Dec
(35) |
2013 |
Jan
(67) |
Feb
(39) |
Mar
(18) |
Apr
(42) |
May
(79) |
Jun
(1) |
Jul
(19) |
Aug
(18) |
Sep
(54) |
Oct
(79) |
Nov
(9) |
Dec
(26) |
2014 |
Jan
(30) |
Feb
(44) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(1) |
Jul
(89) |
Aug
(15) |
Sep
(7) |
Oct
(6) |
Nov
(20) |
Dec
(27) |
2015 |
Jan
(107) |
Feb
(106) |
Mar
(130) |
Apr
(90) |
May
(147) |
Jun
(28) |
Jul
(53) |
Aug
(16) |
Sep
(23) |
Oct
(7) |
Nov
|
Dec
(16) |
2016 |
Jan
(86) |
Feb
(41) |
Mar
(38) |
Apr
(31) |
May
(37) |
Jun
(11) |
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(1) |
Nov
(5) |
Dec
(3) |
2017 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2018 |
Jan
(1) |
Feb
(1) |
Mar
(7) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(3) |
Dec
|
2020 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
(11) |
2022 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2024 |
Jan
(1) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jan D. <ja...@ja...> - 2009-07-18 09:32:30
|
Geoffrey Brown wrote: > I've been creating little examples to see if I understand the semantics > of myhdl. > I came across one where the behavior differs completely depending > upon the initial value of a signal (no problem there), but the generated > verilog > is identical There is an issue with initial values and conversion, and it's listed as an open task. For more info: http://www.myhdl.org/doku.php/dev:tasks#initial_values_support -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Joseph C. <ca...@au...> - 2009-07-18 01:49:24
|
On Jul 17, 2009, at 1:34 PM, Jan Decaluwe wrote: > Joseph Cali wrote: >> You are correct that Example 2 can be solved with an MSB detector >> (not only solved, but solved more efficiently) and in that sense it >> is >> not an ideal example. The general form of the question is how to >> write >> large combinational encoders and decoders in myhdl where neither the >> input nor the output are binary. I will look at the EnumItem >> suggestion >> in the coming days. > > Please be precise in what you are asking. You original post mentioned > "how to implement in MyHDL" but from the context I inferred you were > asking how to *convert* a *specific* design problem from MyHDL to > Verilog, probably for synthesis. Now you suggest your example was only > meant to illustrate a general case. If you want meaningful feedback, > don't make me guess. > Right, that was my mistake. I will be sure to make my questions more clear in the future. You provided a great solution to that specific problem, which made me realize that I did not give a solid example with a proper description. > There's a *very* big difference between > > 1) modeling > 2) conversion to Verilog/VHDL > 3) synthesis > I understand the distinctions here quite well. I will be sure to use the correct terminology in any further conversation on this list. > Modeling in MyHDL is intended to be completely general in the Python > sense. Much, much more powerful than Verilog. > > Conversion is very restrictive. Synthesis is even more restrictive. > Moreover, I can't control synthesis contraints. > > My goal with conversion is the following: whatever you may want to > write in Verilog *for synthesis*, should be easier or as easy to do > with MyHDL. But there's no way in which MyHDL can magically avoid > synthesis restrictions. Therefore, if synthesis is your concern, > you should also understand synthesis itself quite well. > All the reasoning here is sound. > Jan > > -- > 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 > Analog design automation: http://www.mephisto-da.com > World-class digital design: http://www.easics.com > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list Joseph |
From: Christopher F. <chr...@gm...> - 2009-07-17 18:47:17
|
Ignore the previous post, I ran across this error with an older release. I tested with the latest release and it is working fine. Sorry for any confusion. On Fri, Jul 17, 2009 at 9:26 AM, Felton Christopher <chr...@gm...>wrote: > if you have a simple always_comb generator > > @always_comb > def rtl_addr(): > addr.next = concat(addr_hi, addr_lo) > > you will get an error (in simulation) that the sensitivity list is empty. > The analyze (??) code must not be able to determine the signals inside of a > function? > > Chris > |
From: Jan D. <ja...@ja...> - 2009-07-17 18:33:58
|
Joseph Cali wrote: > You are correct that Example 2 can be solved with an MSB detector > (not only solved, but solved more efficiently) and in that sense it is > not an ideal example. The general form of the question is how to write > large combinational encoders and decoders in myhdl where neither the > input nor the output are binary. I will look at the EnumItem suggestion > in the coming days. Please be precise in what you are asking. You original post mentioned "how to implement in MyHDL" but from the context I inferred you were asking how to *convert* a *specific* design problem from MyHDL to Verilog, probably for synthesis. Now you suggest your example was only meant to illustrate a general case. If you want meaningful feedback, don't make me guess. There's a *very* big difference between 1) modeling 2) conversion to Verilog/VHDL 3) synthesis Modeling in MyHDL is intended to be completely general in the Python sense. Much, much more powerful than Verilog. Conversion is very restrictive. Synthesis is even more restrictive. Moreover, I can't control synthesis contraints. My goal with conversion is the following: whatever you may want to write in Verilog *for synthesis*, should be easier or as easy to do with MyHDL. But there's no way in which MyHDL can magically avoid synthesis restrictions. Therefore, if synthesis is your concern, you should also understand synthesis itself quite well. Jan -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Felton C. <chr...@gm...> - 2009-07-17 14:26:31
|
if you have a simple always_comb generator @always_comb def rtl_addr(): addr.next = concat(addr_hi, addr_lo) you will get an error (in simulation) that the sensitivity list is empty. The analyze (??) code must not be able to determine the signals inside of a function? Chris |
From: Joseph C. <ca...@au...> - 2009-07-17 03:36:47
|
You are correct that Example 2 can be solved with an MSB detector (not only solved, but solved more efficiently) and in that sense it is not an ideal example. The general form of the question is how to write large combinational encoders and decoders in myhdl where neither the input nor the output are binary. I will look at the EnumItem suggestion in the coming days. I am more than willing to provide examples that show other design problems not directly addressed in the existing examples. The examples provided on the myhdl site are excellent but having extra examples cannot hurt. I intended to preface my first e-mail by stating that I would be traveling early this week and not have Internet access. Thanks for the help, Joseph >>> Jan Decaluwe <ja...@ja...> 07/14/09 4:46 AM >>> Your examples clearly have a logic structure. In such cases, I think it's often better to use that structure instead of look-up tables. Look-up tables are ideal for unstructured logic values. Example 1 is apparently nothing else than (1 << address) - 1. Example 2 is interesting, it can be solved with an msb detector. It is in example I would consider putting on the website, because it may show some interesting convertor features. Just loop over de bit indices from high to low. As soon as a 1 is found, assign the current index to the result and break out of the loop. In Verilog, this is awkward, because you need to use named blocks and disable statements. However, the MyHDL convertor can do this automatically. Many people probably don't realize that this is perfectly synthesizable (expecially because of the awkwardness in Verilog) so it may be a good example of how MyHDL can help. Jan Joseph Cali wrote: > I understand how to implement the following in MyHDL (this was generated using toVerilog): > > ---------------------------------------------------------------------------------- > module binary2thermometer ( > value, > address > ); > > output [30:0] value; > reg [30:0] value; > input [4:0] address; > > always @(address) begin: BINARY2THERMOMETER_READ > // synthesis parallel_case full_case > case (address) > 0: value <= 1; > 1: value <= 3; > 3: value <= 15; > 4: value <= 31; > 5: value <= 63; > 6: value <= 127; > 7: value <= 255; > 8: value <= 511; > 9: value <= 1023; > 10: value <= 2047; > 11: value <= 4095; > 12: value <= 8191; > 13: value <= 16383; > 14: value <= 32767; > 15: value <= 65535; > . > . > . > endcase > end > endmodule > ---------------------------------------------------------------------------------- > > But how would I model the inverse in MyHDL (this was not done through MyHDL): > > ---------------------------------------------------------------------------------- > module thermometer2binary ( > value, > address > ); > > output [4:0] value; > reg [4:0] value; > input [30:0] address; > > always @(address) begin: BINARY2THERMOMETER_READ > // synthesis parallel_case full_case > case (address) > 1: value <= 1; > 3: value <= 2; > 15: value <= 3; > 31: value <= 4; > 63: value <= 5; > 127: value <= 6; > 255: value <= 7; > 511: value <= 8; > 1023: value <= 9; > 2047: value <= 10; > 4095: value <= 11; > 8191: value <= 12; > 16383: value <= 13; > 32767: value <= 14; > 65535: value <= 15; > . > . > . > endcase > end > endmodule > ---------------------------------------------------------------------------------- > > Also, have you considered using Python dictionaries to infer ROMs and other large combinational logic instead of tuples? I recently stumbled upon MyHDL and I immediately connected with the idea. > > Thanks for the help. > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ myhdl-list mailing list myh...@li... https://lists.sourceforge.net/lists/listinfo/myhdl-list |
From: Geoffrey B. <geo...@in...> - 2009-07-16 14:29:21
|
Sorry, Moore should be Mealy On Thu, Jul 16, 2009 at 10:17 AM, Geoffrey Brown <geo...@in...>wrote: > I've been creating little examples to see if I understand the semantics of > myhdl. > I came across one where the behavior differs completely depending > upon the initial value of a signal (no problem there), but the generated > verilog > is identical -- see the attached and consider two alternatives: > > t = Signal(bool(not state)) > t = Signal(bool(0)) > > In the first case, the simulation does what I expected -- the state > alternates while in > the second case its frozen at its initial value. I can understand why this > might happen, > I'm just not sure it should. The fundamental issue has to do with > initialization of the > simulation. In the second case, the state is inconsistent with the > combinational > logic, but there is no event to trigger the necessary change. > > I was trying to understand how a Moore machine might be coded > and simulated in myhdl. I know this isn't always the design pattern of > choice, > but if you want to implement the handshake of communicating processes, this > is what falls out. > > Geoffrey Brown > > |
From: Amway I. <i....@ya...> - 2009-07-15 20:40:19
|
Hi Does Co-simulation with iverilog work in Fedora 10 ? make fails in fedora 10. Vimal Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ |
From: Jan D. <ja...@ja...> - 2009-07-15 07:45:04
|
Felton Christopher wrote: > On Jul 14, 2009, at 4:36 AM, Jan Decaluwe wrote: > >> Felton Christopher wrote: >>> Does it make sense to add the following to the EnumItem class? >>> >>> def __int__(self): >>> return int(self._val) >>> >>> def __long__(self): >>> return long(self._val) >>> >>> def __float__(self): >>> return float(self._val) >> Probably, unless you also expect this to be easily convertible? > > Yeah, I guess that would of been part of it as well. I had a design I > was converting from Verilog. In this particular case I had a packet > decoder. The first part of the packet was some command structure the > last part data. To decode the command portion the "state" variable is > assigned to state and compared to state. Later the same variable > counts through the rest of the packet. Essentially the "state" was a > simple byte counter. > > In that case, I would do something like >>> state.next = state + 1 > > This probably does not make sense. When using the enum it should only > be used with strictly with a state variable. Such that the underlying > value is not known or directly needed. Yes - if the value is needed I suggest to use symbolic constants instead. -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Felton C. <chr...@gm...> - 2009-07-14 11:21:09
|
On Jul 14, 2009, at 4:36 AM, Jan Decaluwe wrote: > Felton Christopher wrote: >> >> Does it make sense to add the following to the EnumItem class? >> >> def __int__(self): >> return int(self._val) >> >> def __long__(self): >> return long(self._val) >> >> def __float__(self): >> return float(self._val) > > Probably, unless you also expect this to be easily convertible? Yeah, I guess that would of been part of it as well. I had a design I was converting from Verilog. In this particular case I had a packet decoder. The first part of the packet was some command structure the last part data. To decode the command portion the "state" variable is assigned to state and compared to state. Later the same variable counts through the rest of the packet. Essentially the "state" was a simple byte counter. In that case, I would do something like >>> state.next = state + 1 This probably does not make sense. When using the enum it should only be used with strictly with a state variable. Such that the underlying value is not known or directly needed. Thanks |
From: Jan D. <ja...@ja...> - 2009-07-14 09:45:40
|
Your examples clearly have a logic structure. In such cases, I think it's often better to use that structure instead of look-up tables. Look-up tables are ideal for unstructured logic values. Example 1 is apparently nothing else than (1 << address) - 1. Example 2 is interesting, it can be solved with an msb detector. It is in example I would consider putting on the website, because it may show some interesting convertor features. Just loop over de bit indices from high to low. As soon as a 1 is found, assign the current index to the result and break out of the loop. In Verilog, this is awkward, because you need to use named blocks and disable statements. However, the MyHDL convertor can do this automatically. Many people probably don't realize that this is perfectly synthesizable (expecially because of the awkwardness in Verilog) so it may be a good example of how MyHDL can help. Jan Joseph Cali wrote: > I understand how to implement the following in MyHDL (this was generated using toVerilog): > > ---------------------------------------------------------------------------------- > module binary2thermometer ( > value, > address > ); > > output [30:0] value; > reg [30:0] value; > input [4:0] address; > > always @(address) begin: BINARY2THERMOMETER_READ > // synthesis parallel_case full_case > case (address) > 0: value <= 1; > 1: value <= 3; > 3: value <= 15; > 4: value <= 31; > 5: value <= 63; > 6: value <= 127; > 7: value <= 255; > 8: value <= 511; > 9: value <= 1023; > 10: value <= 2047; > 11: value <= 4095; > 12: value <= 8191; > 13: value <= 16383; > 14: value <= 32767; > 15: value <= 65535; > . > . > . > endcase > end > endmodule > ---------------------------------------------------------------------------------- > > But how would I model the inverse in MyHDL (this was not done through MyHDL): > > ---------------------------------------------------------------------------------- > module thermometer2binary ( > value, > address > ); > > output [4:0] value; > reg [4:0] value; > input [30:0] address; > > always @(address) begin: BINARY2THERMOMETER_READ > // synthesis parallel_case full_case > case (address) > 1: value <= 1; > 3: value <= 2; > 15: value <= 3; > 31: value <= 4; > 63: value <= 5; > 127: value <= 6; > 255: value <= 7; > 511: value <= 8; > 1023: value <= 9; > 2047: value <= 10; > 4095: value <= 11; > 8191: value <= 12; > 16383: value <= 13; > 32767: value <= 14; > 65535: value <= 15; > . > . > . > endcase > end > endmodule > ---------------------------------------------------------------------------------- > > Also, have you considered using Python dictionaries to infer ROMs and other large combinational logic instead of tuples? I recently stumbled upon MyHDL and I immediately connected with the idea. > > Thanks for the help. > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Jan D. <ja...@ja...> - 2009-07-14 09:35:59
|
Felton Christopher wrote: > > Does it make sense to add the following to the EnumItem class? > > def __int__(self): > return int(self._val) > > def __long__(self): > return long(self._val) > > def __float__(self): > return float(self._val) Probably, unless you also expect this to be easily convertible? -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Felton C. <chr...@gm...> - 2009-07-12 18:43:04
|
Does it make sense to add the following to the EnumItem class? def __int__(self): return int(self._val) def __long__(self): return long(self._val) def __float__(self): return float(self._val) Thanks |
From: Joseph C. <ca...@au...> - 2009-07-12 15:12:16
|
I understand how to implement the following in MyHDL (this was generated using toVerilog): ---------------------------------------------------------------------------------- module binary2thermometer ( value, address ); output [30:0] value; reg [30:0] value; input [4:0] address; always @(address) begin: BINARY2THERMOMETER_READ // synthesis parallel_case full_case case (address) 0: value <= 1; 1: value <= 3; 3: value <= 15; 4: value <= 31; 5: value <= 63; 6: value <= 127; 7: value <= 255; 8: value <= 511; 9: value <= 1023; 10: value <= 2047; 11: value <= 4095; 12: value <= 8191; 13: value <= 16383; 14: value <= 32767; 15: value <= 65535; . . . endcase end endmodule ---------------------------------------------------------------------------------- But how would I model the inverse in MyHDL (this was not done through MyHDL): ---------------------------------------------------------------------------------- module thermometer2binary ( value, address ); output [4:0] value; reg [4:0] value; input [30:0] address; always @(address) begin: BINARY2THERMOMETER_READ // synthesis parallel_case full_case case (address) 1: value <= 1; 3: value <= 2; 15: value <= 3; 31: value <= 4; 63: value <= 5; 127: value <= 6; 255: value <= 7; 511: value <= 8; 1023: value <= 9; 2047: value <= 10; 4095: value <= 11; 8191: value <= 12; 16383: value <= 13; 32767: value <= 14; 65535: value <= 15; . . . endcase end endmodule ---------------------------------------------------------------------------------- Also, have you considered using Python dictionaries to infer ROMs and other large combinational logic instead of tuples? I recently stumbled upon MyHDL and I immediately connected with the idea. Thanks for the help. |
From: Jan D. <ja...@ja...> - 2009-07-11 07:27:48
|
Amway India wrote: > Hello > > test_dff.py is once again enclosed > > from random import randrange > > def test_dff(): > q, d, clk = [Signal(bool(0)) for i in range(3)] > > dff_inst = dff(q,d,clk) > > @always (delay (10)) > def clkgen(): > clk.next = not clk > > @always (clk.negedge) > def stimulus (): > d.next = randrange(2) > > return dff_inst, clkgen, stimulus > > > def simulate (timesteps): > tb = traceSignals(test_dff) > sim = Simulation(tb) > sim.run(timesteps) > > simulate(2000) > ********************************************** > The Above is the test_dff.py code. > The following is the run result > ********************************************** > [vimal@vlsiworkgroup cordichdl]$ python test_dff.py > Traceback (most recent call last): > File "test_dff.py", line 24, in <module> > simulate(2000) > File "test_dff.py", line 20, in simulate > tb = traceSignals(test_dff) > NameError: global name 'traceSignals' is not defined > *************************************************** > > I hope i used traceSignals. Where is the wrong? The error is what is says: traceSignals is not defined. Import it from package myhdl, or use 'from myhdl import *' to import all identifiers from myhdl. You may want to check how identifier definition and imports work in python in general. Jan -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Amway I. <i....@ya...> - 2009-07-11 07:14:28
|
Hello test_dff.py is once again enclosed from random import randrange def test_dff(): q, d, clk = [Signal(bool(0)) for i in range(3)] dff_inst = dff(q,d,clk) @always (delay (10)) def clkgen(): clk.next = not clk @always (clk.negedge) def stimulus (): d.next = randrange(2) return dff_inst, clkgen, stimulus def simulate (timesteps): tb = traceSignals(test_dff) sim = Simulation(tb) sim.run(timesteps) simulate(2000) ********************************************** The Above is the test_dff.py code. The following is the run result ********************************************** [vimal@vlsiworkgroup cordichdl]$ python test_dff.py Traceback (most recent call last): File "test_dff.py", line 24, in <module> simulate(2000) File "test_dff.py", line 20, in simulate tb = traceSignals(test_dff) NameError: global name 'traceSignals' is not defined *************************************************** I hope i used traceSignals. Where is the wrong? --- On Fri, 10/7/09, Jan Decaluwe <ja...@ja...> wrote: From: Jan Decaluwe <ja...@ja...> Subject: Re: [myhdl-list] dff To: myh...@li... Date: Friday, 10 July, 2009, 7:42 PM Amway India wrote: > Hello Everybody > > To day tried to run dff model from myhdl documentation and it is giving > some errors which are enclosed. I wrote two files 1.dff.py and 2. > test_dff.py: > > dff.py > from myhdl import * > def dff(q, d, clk): > @always(clk.posedge) > def logic(): > q.next = d > return logic > > test_dff.py > from random import randrange > def test_dff(): > q, d, clk = [Signal(bool(0)) for i in range(3)] > dff_inst = dff(q, d, clk) > @always(delay(10)) > def clkgen(): > clk.next = not clk > @always(clk.negedge) > def stimulus(): > d.next = randrange(2) > return dff_inst, clkgen, stimulus > def simulate(timesteps): > tb = traceSignals(test_dff) > sim = Simulation(tb) > sim.run(timesteps) > simulate(2000) > > When i run > $python test_dff.py gives > traceSignal not defined > > What is the reason? traceSignal is indeed not defined in package myhdl. traceSignals should be. -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ myhdl-list mailing list myh...@li... https://lists.sourceforge.net/lists/listinfo/myhdl-list Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ |
From: Jan D. <ja...@ja...> - 2009-07-10 20:05:16
|
Amway India wrote: > Hello Everybody > > To day tried to run dff model from myhdl documentation and it is giving > some errors which are enclosed. I wrote two files 1.dff.py and 2. > test_dff.py: > > dff.py > from myhdl import * > def dff(q, d, clk): > @always(clk.posedge) > def logic(): > q.next = d > return logic > > test_dff.py > from random import randrange > def test_dff(): > q, d, clk = [Signal(bool(0)) for i in range(3)] > dff_inst = dff(q, d, clk) > @always(delay(10)) > def clkgen(): > clk.next = not clk > @always(clk.negedge) > def stimulus(): > d.next = randrange(2) > return dff_inst, clkgen, stimulus > def simulate(timesteps): > tb = traceSignals(test_dff) > sim = Simulation(tb) > sim.run(timesteps) > simulate(2000) > > When i run > $python test_dff.py gives > traceSignal not defined > > What is the reason? traceSignal is indeed not defined in package myhdl. traceSignals should be. -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Amway I. <i....@ya...> - 2009-07-10 19:15:46
|
Hello Everybody To day tried to run dff model from myhdl documentation and it is giving some errors which are enclosed. I wrote two files 1.dff.py and 2. test_dff.py: dff.py from myhdl import * def dff(q, d, clk): @always(clk.posedge) def logic(): q.next = d return logic test_dff.py from random import randrange def test_dff(): q, d, clk = [Signal(bool(0)) for i in range(3)] dff_inst = dff(q, d, clk) @always(delay(10)) def clkgen(): clk.next = not clk @always(clk.negedge) def stimulus(): d.next = randrange(2) return dff_inst, clkgen, stimulus def simulate(timesteps): tb = traceSignals(test_dff) sim = Simulation(tb) sim.run(timesteps) simulate(2000) When i run $python test_dff.py gives traceSignal not defined What is the reason? Love Cricket? Check out live scores, photos, video highlights and more. Click here http://cricket.yahoo.com |
From: Jan D. <ja...@ja...> - 2009-07-10 06:22:43
|
Christopher Felton wrote: > > I'm not changing anything in our current setup, but I have > enabled mercurial for MyHDL at SourceForge, and I will keep > the repository there up to date also. This can be useful > for people coming to MyHDL through SourceForge. It is > also an additional back-up. > > > That is pretty interesting, it shows some of the flexibility and > features of a distributed version control system like mercurial. Easily > keep different repositories in sync. Indeed, with distributed version control all kinds of useful work flows become easy and natural. It is easy to forget how complicated things were with centralized systems. I don't want to go back. I'm also happy with the particular choice of mercurial. It fits my brain. Moreover, it seems more and more projects are switching to it (or supporting it, like SourceForge). Python itself, for example. Mercurial clearly is a winner. Jan -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Christopher F. <chr...@gm...> - 2009-07-09 20:41:10
|
> > > I'm not changing anything in our current setup, but I have > enabled mercurial for MyHDL at SourceForge, and I will keep > the repository there up to date also. This can be useful > for people coming to MyHDL through SourceForge. It is > also an additional back-up. > That is pretty interesting, it shows some of the flexibility and features of a distributed version control system like mercurial. Easily keep different repositories in sync. Chris |
From: Jan D. <ja...@ja...> - 2009-07-09 20:17:12
|
Sourceforge has made some major changes lately. In addition to a new interface, they offer a lot of new services. In particular, there is now support for mercurial hosting. I'm not changing anything in our current setup, but I have enabled mercurial for MyHDL at SourceForge, and I will keep the repository there up to date also. This can be useful for people coming to MyHDL through SourceForge. It is also an additional back-up. Jan -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Jan D. <ja...@ja...> - 2009-07-09 16:33:20
|
Felton Christopher wrote: >> Christopher Felton wrote: >>> On Tue, Jun 23, 2009 at 3:47 AM, Jan Decaluwe <ja...@ja...> >>> wrote: >>>> Basically I tried to address the problem that some of >>>> you have struggled with: the inflexibility of MyHDL signals. >>>> For example, the fact that signal slices don't behave >>>> as signals. >>>> >>>> It's all documented here: >>>> >>>> http://www.myhdl.org/doku.php/meps:mep-105 >>>> >>>> Feedback welcome! >>>> >>>> Jan >>> I pulled the latest code from the repository this morning and was >>> unable to check if a variable was a "Signal". It looks like the >>> "Signal" changed from a class to a function? >> Yes, I turned it into a factory function. The existing implementation >> was way to complex (i.e. using __new__ to construct different Signal >> subclasses depending on constructor parameters. With the additional >> Signal subclasses coming up, this was becoming really ugly. >> >> I thought this would be an innocent change - I didn't anticipate >> that a MyHDL user would ever need to test whether an object belongs >> to the Signal class. Why do you need this? >> > > I don't know if this is a "need". I have used this approach for some > designs. As mentioned mainly for modeling and testbenching. If the > change is not backward compatible I need to go modify the usage. > > >> My "use case", I have used this in modeling modules. A module might > >> be used outside myhdl environment and will except basic inputs. The > >> same module is used in a testbench and thus the module is flexible > to > >> use a Signal or not. > > In my case, I had some algorithms (modules) prior to utilizing myhdl > (or after). I reused these modules by adding a Signal type and not > rewriting a separate module for testbenches. In this example, the > modules still work with my standard python scripts but also work with > my hdl testbenches. > > A trivial example (not realistic example, too simple). Say I had a > module that added two types > > def myadd(a, b, c): > c = a + b > > I would have changed the module so I could use it in a testbench to > something like the following > > def myadd(a, b, c): > if isinstance(c, myhdl.Signal): > c.next = a + b > else: > c = a + b > > note, most of the time 'c' is of type numpy.ndarray. > > As mentioned, the module would be compatible with previous usage but > now it would also be utilized in testbenching and modeling. The > example I used is overly simple, the usage would apply to something a > little more complex. I would not want dual maintenance for separate > modules. > > I do this often when a DSP algorithm is generated. Usually an > algorithm is developed, at the algorithm level, and not hardware > level. At some point later this original algorithm will be used as a > golden model in the testbench to validate the hdl implementation. At > that point I add the Signal usage. Yes, this ends up being a little > after thought but not all algorithms are used with hdl simulation > adding from the start hasn't made sense yet, that could change. > > Maybe there is a better way to handle this that I have not considered? Somehow this doesn't feel right to me. If I understand you well, you have to use type checks in the middle of your algorithms to make it work in different modes. I don't know whether it's feasible, but I think the right way would be polymorphism, that is, objects of different types that can work with the same algorithm unchanged. Of course, I understand that MyHDL's signal assignment is a bit special. The question is whether you can't use a wrapper class around some other types to make them work with the same kind of attribute assignment. Also, are you sure you need signals? Internally in an algorithm I think plain variables would be OK, if not better, as they correspond to "normal" semantics. (Signals are different, and HDL-specific.) Also, note that the MyHDL signal is in fact designed to take any kind of object as underlying value. (Warning: I never extensively tried that with "non-HDL" types.) Note that def myadd(a, b, c): c = a + b can't work, as c will become a local variable in Python. I understand this is a small example, but still, it shows that you would have to use a different kind of assignment (slice or attribute) that modifies an existing object, like MyHDL wants you to do for signals and also for intbv's if they have to be convertible. If that paradigm is followed, the wrapper idea mentioned above might work. Jan -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Jan D. <ja...@ja...> - 2009-07-06 09:54:14
|
Christopher Felton wrote: > Is it possible to get the delete permission on the user space. I am > unable to upload new versions of a image (or any media) or remove unused > media. I end up having to create new names for each version. I have added this permission for registered users in namespace projects and users. -- 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 Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |
From: Christopher F. <chr...@gm...> - 2009-07-04 15:25:59
|
Is it possible to get the delete permission on the user space. I am unable to upload new versions of a image (or any media) or remove unused media. I end up having to create new names for each version. The following is from the dokuwiki manuals Removing Media It is sometimes necessary to remove a media, which was being uploaded before. To do this the ACL <http://www.dokuwiki.org/acl> feature needs to be enabled and the user who wants to delete files needs to have the DELETE permission. Files can be deleted with the garbage can icon then. See also: deleting media files <http://www.dokuwiki.org/faq:deletemedia> Thanks Chris |
From: Felton C. <chr...@gm...> - 2009-06-25 13:07:02
|
> Christopher Felton wrote: >> On Tue, Jun 23, 2009 at 3:47 AM, Jan Decaluwe <ja...@ja...> >> wrote: >>> Basically I tried to address the problem that some of >>> you have struggled with: the inflexibility of MyHDL signals. >>> For example, the fact that signal slices don't behave >>> as signals. >>> >>> It's all documented here: >>> >>> http://www.myhdl.org/doku.php/meps:mep-105 >>> >>> Feedback welcome! >>> >>> Jan >> >> I pulled the latest code from the repository this morning and was >> unable to check if a variable was a "Signal". It looks like the >> "Signal" changed from a class to a function? > > Yes, I turned it into a factory function. The existing implementation > was way to complex (i.e. using __new__ to construct different Signal > subclasses depending on constructor parameters. With the additional > Signal subclasses coming up, this was becoming really ugly. > > I thought this would be an innocent change - I didn't anticipate > that a MyHDL user would ever need to test whether an object belongs > to the Signal class. Why do you need this? > I don't know if this is a "need". I have used this approach for some designs. As mentioned mainly for modeling and testbenching. If the change is not backward compatible I need to go modify the usage. >> My "use case", I have used this in modeling modules. A module might >> be used outside myhdl environment and will except basic inputs. The >> same module is used in a testbench and thus the module is flexible to >> use a Signal or not. In my case, I had some algorithms (modules) prior to utilizing myhdl (or after). I reused these modules by adding a Signal type and not rewriting a separate module for testbenches. In this example, the modules still work with my standard python scripts but also work with my hdl testbenches. A trivial example (not realistic example, too simple). Say I had a module that added two types def myadd(a, b, c): c = a + b I would have changed the module so I could use it in a testbench to something like the following def myadd(a, b, c): if isinstance(c, myhdl.Signal): c.next = a + b else: c = a + b note, most of the time 'c' is of type numpy.ndarray. As mentioned, the module would be compatible with previous usage but now it would also be utilized in testbenching and modeling. The example I used is overly simple, the usage would apply to something a little more complex. I would not want dual maintenance for separate modules. I do this often when a DSP algorithm is generated. Usually an algorithm is developed, at the algorithm level, and not hardware level. At some point later this original algorithm will be used as a golden model in the testbench to validate the hdl implementation. At that point I add the Signal usage. Yes, this ends up being a little after thought but not all algorithms are used with hdl simulation adding from the start hasn't made sense yet, that could change. Maybe there is a better way to handle this that I have not considered? |