lekernel changed the topic of #m-labs to: Mixxeo, Migen, MiSoC & other M-Labs projects :: fka #milkymist :: Logs http://irclog.whitequark.org/m-labs
qwebirc27866 has quit [Ping timeout: 272 seconds]
os1r1s has left #m-labs ["Leaving..."]
wpwrak_ has quit [Ping timeout: 260 seconds]
wpwrak has joined #m-labs
qwebirc3348 has joined #m-labs
<qwebirc3348> I need to write a test bench for my D flip-flop http://pastebin.com/w4jazbqb
<qwebirc3348> I would like to control the clock and also feed a random data as shown here http://www.myhdl.org/doku.php/cookbook:ff
<qwebirc3348> Could anyone help me in writing one ?
<qwebirc3348> I need to know how to control the clock signal - In migen for synchronous circuits, automatically the reset and clock signals come
<qwebirc3348> how to access these ?
kristianpaul has quit [Ping timeout: 264 seconds]
kristianpaul has joined #m-labs
_franck_web_ has joined #m-labs
kristianpaul has quit [Ping timeout: 245 seconds]
<qwebirc3348> Hi, I found the solution http://pastebin.com/BcJ8BaRf
kristianpaul has joined #m-labs
kristianpaul has quit [Changing host]
kristianpaul has joined #m-labs
lekernel has joined #m-labs
lekernel has quit [Read error: Connection reset by peer]
lekernel has joined #m-labs
qwebirc3348 has quit [Ping timeout: 272 seconds]
xiangfu has quit [Ping timeout: 272 seconds]
xiangfu has joined #m-labs
jaeckel has quit [Ping timeout: 252 seconds]
jaeckel has joined #m-labs
qwebirc44805 has joined #m-labs
<qwebirc44805> I have finished my D flip flop http://pastebin.com/BcJ8BaRf
<qwebirc44805> In my simulation part
<qwebirc44805> def do_simulation(self,s): s.wr(D,randrange(2))
<qwebirc44805> s.wr copies the data only after the positive edge of the clock
<qwebirc44805> is there any ways to move it to the negative clock ?
<qwebirc44805> i.e copy in the negative clock ?
xiangfu has quit [Remote host closed the connection]
<lekernel> qwebirc44805, no, why would you need that?
<lekernel> do it in the previous cycle
qwebirc44805 has quit [Ping timeout: 272 seconds]
<ysionneau> lekernel: compiling gcc 4.8.2 for target lm32-elf takes almost all my RAM (on 4 GB machine) to compile gcc-4.8.2/newlib/libc/argz/'`argz_create.c and then it does an ICE
<ysionneau> I cannot even compile it
<ysionneau> it says to submit a bug report :)
<ysionneau> does it mean they will care about it ? =)
<lekernel> I don't think so
<lekernel> have you done a stack trace? perhaps that's the infinite recursion bug I mentioned
<lekernel> but then someone has to dig deep into the gcc code to fix it
<lekernel> maybe ask your contact at embecosm
<ysionneau> http://pastebin.com/R6ijccLX < I've got this kind of error
<ysionneau> yes I think I will end up asking him ^^
<ysionneau> is this the stack trace you are talking about?
<lekernel> hmm, that looks like a new bug
<ysionneau> I'm using latest version of each component : binutils mpc mpfr gmp gcc newlib
<ysionneau> latest release of each*
<ysionneau> maybe it's not the wiser move :p
<ysionneau> let's try to see if Jörn has any idea about that
lekernel has quit [Ping timeout: 252 seconds]
lekernel has joined #m-labs
_franck_web_ has quit [Ping timeout: 272 seconds]
qwebirc3869 has joined #m-labs
<qwebirc3869> while writing test bench, how can I access the reset and clock ? can I access it using s.we ?
<ysionneau> I think it's something like s.rd(your_signal)
<ysionneau> like s.rd(self.your_signal_nameà
<ysionneau> )
qwebirc13993 has joined #m-labs
<qwebirc13993> what about reset ?
<ysionneau> what do you mean ?
qwebirc3869 has quit [Ping timeout: 272 seconds]
<ysionneau> if you want to write the reset signal during your simulation you can do something like : s.wr(self.rstsignal_name)
<qwebirc13993> what should I do if I want to set the reset on a synchronous circuit
<qwebirc13993> OK thanks
<lekernel> qwebirc13993, why do you want to access the reset and clock?
<qwebirc13993> to control from the test bench
<lekernel> sure, but why?
<lekernel> don't the autogenerated signals suit you?
<qwebirc13993> I don't know how to use them.
<lekernel> you have a perpetually toggling clock, and a reset signal active at the beginning
<qwebirc13993> I.e access them
<lekernel> it's automatically connected to "sync" statements
<lekernel> why do you want to access them? they are already driven by default, with a pattern that suits most uses imo
<lekernel> especially as it seems your code is just a DFF - you don't need anything complicated
<qwebirc13993> I.e self.sync.rst ?
<lekernel> self.sync.rst accesses sync statements in a clock domain named "rst", which is probably not what you want
<lekernel> "self.sync += <statement>" adds a statement that is executed at each cycle of the autogenerated simulation clock
<lekernel> it's simple as that
<lekernel> you can look at the VCD file if you don't believe me about the autogenerated clock/reset
<lekernel> if you really need to access the reset signal, you have to define a clock domain yourself
qwebirc20659 has joined #m-labs
<qwebirc20659> sorry. I am the d flip flop guy
qwebirc13993 has quit [Ping timeout: 272 seconds]
<qwebirc20659> currently I am traveling in train . my connection is getting reset and so I might show in a new name
<lekernel> <lekernel> self.sync.rst accesses sync statements in a clock domain named "rst", which is probably not what you want
<lekernel> <lekernel> "self.sync += <statement>" adds a statement that is executed at each cycle of the autogenerated simulation clock
<lekernel> <lekernel> it's simple as that
<lekernel> <lekernel> you can look at the VCD file if you don't believe me about the autogenerated clock/reset
<lekernel> <lekernel> if you really need to access the reset signal, you have to define a clock domain yourself
<qwebirc20659> while testing my d flip flop i wasn't too test it by controlling the reset myself
<lekernel> that will work. you don't need to test it.
<qwebirc20659> thanks. I will contact later. thanks for clarifying my doubts
<lekernel> resets are one thing Migen handles automatically for you, and it's bug-free in much more complex cases than a DFF
qwebirc20659 has quit [Ping timeout: 272 seconds]
xiangfu has joined #m-labs
xiangfu has quit [Ping timeout: 248 seconds]
xiangfu has joined #m-labs
mumptai has joined #m-labs
<davidc__> yeah; resets generally 'just work', well, for a single synchronous clock domain :)
<lekernel> simulation only supports one clock domain atm
<larsc> does migen insert a async FF for cross clock dmain resets?
<lekernel> you have to connect reset signals manually, and insert the appropriate synchronizers
<davidc__> lekernel: yeah.. I have some horrific code for multidomain
mumptai has quit [Quit: Verlassend]
Alarm has joined #m-labs
qwebirc18366 has joined #m-labs
<qwebirc18366> does anyone know why s.wr copies the data only after the positive edge of the clock
<qwebirc18366> ?
<qwebirc18366> just for reference - my flipflop s.wr copies the data only after the positive edge of the clock
<qwebirc18366> sorry
<qwebirc18366> just for reference - my flipflop http://pastebin.com/BcJ8BaRf
<qwebirc18366> are there any reasons for having such a design ?
<davidc__> qwebirc18366: for synchronous designs; this is typically the model you want
<qwebirc18366> it really confused me for some time when i simulated my flip flop
<davidc__> qwebirc18366: IE, the s.wr is for providing stimulation for the next cycle
<qwebirc18366> oh!
<davidc__> (well, in do_simulation)
jaeckel has quit [Remote host closed the connection]
<qwebirc18366> when i simulated the d flip flop, in gtkwave I was expecting this http://macao.communications.museum/images/exhibits/2_19_0_1.png
<qwebirc18366> but since s.wr copies the data only after the positive edge of the clock there was a big confusion
<qwebirc18366> I thought migen had options like delaying the clock and also updating data in the negative clock cycle http://www.myhdl.org/doku.php/cookbook:ff
jaeckel has joined #m-labs
<lekernel> qwebirc18366, migen != myhdl
<lekernel> migen has the synchronous concepts built-in
<lekernel> myhdl is like verilog/vhdl
<lekernel> if you want to delay clocks or do stuff on negative edges with migen, you have to define new (synchronous) clock domains. which matches the way the virtually all designs are done... not the lower-level one-delay-per-signal that verilog/vhdl has, and which wastes a lot of engineer time
qwebirc18366 has quit [Ping timeout: 272 seconds]
early has quit [Ping timeout: 245 seconds]
early has joined #m-labs
Alarm has quit [Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310]]
lekernel has quit [Quit: Leaving]
ohama has quit [Ping timeout: 252 seconds]
ohama has joined #m-labs