-------- Original Message --------
Subject:        Re: [M-Labs devel] Error In Simulation Implementation
Date:   Mon, 3 Feb 2014 17:24:36 -0500
From:   Brian McLaughlin <bjmclaugh...@gmail.com>
To:     Sébastien Bourdeauducq <sebastien.bourdeaud...@lekernel.net>,
y...@minet.net



If I may ask one more question? I am having a ton of fun and might write
this up for the GeekDad blog I write for as a way to teach kids about
hardware design.

I implemented a full adder with a nice simulation test harness that
produces a truth table to show that it is working. I then implemented an
8-bit ripple carry adder. Problem is, I am getting an assertion failure
when I try to simulate the ripple carry and it looks like it is trying
to execute the do_simulate method for the FullAdder module too. Is there
any way to indicate that the simulator should only run the top-level
fragment's do_simulation and not sub-modules?

Thanks again for your help. The source code for the FullAdder I
implemented is at:

https://github.com/SpinStabilized/migen_play/blob/master/FullAdder.py

RippleCarryAdder:

https://github.com/SpinStabilized/migen_play/blob/master/RippleCarryAdder.py

Brian


On Sun, Feb 2, 2014 at 8:41 AM, Brian McLaughlin <bjmclaugh...@gmail.com
<mailto:bjmclaugh...@gmail.com>> wrote:

    Thank you both for the response. Made some updates and everything is
    working great. I've attached the code as I had made updates.

    Cheers and thanks for a great tool!
    Brian



    On Sat, Feb 1, 2014 at 4:40 PM, Sébastien Bourdeauducq
    <sebastien.bourdeaud...@lekernel.net
    <mailto:sebastien.bourdeaud...@lekernel.net>> wrote:

        Hi,

        I changed the simulation API recently (unfortunately, about at
        the same
        time as hackaday posted about Migen):

https://ssl.serverraum.org/lists-archive/devel/2014-January/003660.html

        So you should write instead:
        def __init__(...led...):
                self.led = led

        def do_simulation(self, selfp):
                v_led = selfp.led # read the current signal value
        ...
        cycle=selfp.simulator.cycle_counter

        Haven't updated the doc/tutorial yet.

        Sébastien




    --
    Brian McLaughlin

    Twitter <http://twitter.com/bjmclaughlin> | Google+
    <https://plus.google.com/u/0/108481953499321887963/> | GeekDad
    <http://www.geekdad.com> | About Me
    <http://www.makersassemble.com/about-me/>




-- 
Brian McLaughlin

Twitter <http://twitter.com/bjmclaughlin> | Google+
<https://plus.google.com/u/0/108481953499321887963/> | GeekDad
<http://www.geekdad.com> | About Me
<http://www.makersassemble.com/about-me/>


_______________________________________________
Devel mailing list
Devel@lists.milkymist.org
https://ssl.serverraum.org/lists/listinfo/devel

Reply via email to