Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement on/off ports for DVS adapter #1

Open
mhoff opened this issue Mar 26, 2017 · 0 comments
Open

Implement on/off ports for DVS adapter #1

mhoff opened this issue Mar 26, 2017 · 0 comments

Comments

@mhoff
Copy link
Owner

mhoff commented Mar 26, 2017

The DVS adapter should provide three outgoing ports: "out_on" for on-events, "out_off" for off-events and "out" for both kinds of events.

When providing all three ports (see implementation), but not connecting all of them, a SegFault in MUSIC arises, when entering the runtime:

[node16:30140] *** Process received signal ***
[node16:30140] Signal: Segmentation fault (11)
[node16:30140] Signal code:  (128)
[node16:30140] Failing at address: (nil)
[node16:30140] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf890) [0x7f72c657e890]
[node16:30140] [ 1] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC15EventOutputPort10buildTableEv+0x29) [0x7f72c9575d79]
[node16:30140] [ 2] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC7Runtime11buildTablesEPNS_5SetupE+0x24) [0x7f72c9553db4]
[node16:30140] [ 3] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC7RuntimeC1EPNS_5SetupEd+0x2cc) [0x7f72c955483c]
[node16:30140] [ 4] music(_ZN10DVSAdapter11runROSMUSICEv+0x105) [0x40e5b5]
[node16:30140] [ 5] music(main+0x9b) [0x40d6fb]
[node16:30140] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f72c57b9b45]
[node16:30140] [ 7] music() [0x40d828]
[node16:30140] *** End of error message ***

The MUSIC code on the DVS adapter side looks like this:

    // [...]
    port_out = initOutput("out", width_);
    // TODO MUSIC bug ...
    port_out_polarity[true] = NULL; // initOutput("out_on", width_);
    port_out_polarity[false] = NULL; // initOutput("out_off", width_);
}

MUSIC::EventOutputPort* DVSAdapter::initOutput(std::string name, int &width)
{
    MUSIC::EventOutputPort* port = setup->publishEventOutput(name);
    if (port->isConnected())
    {
        if (not port->hasWidth())
        {
            std::cout << "ERROR: port " << name << " has no width" << std::endl;
            comm.Abort(2);
        }

        int width_ = port->width();
        if (width != -1 and width_ != width)
        {
            std::cout << "ERROR: node has inconsistent output widths (" << width << " != " << width_ << ")" << std::endl;
            comm.Abort(3);
        }
        width = width_;

        // map linear index to event out port
        MUSIC::LinearIndex l_index_out(0, width_);
        port->map(&l_index_out, MUSIC::Index::GLOBAL, 1);
    }
    else
    {
        port = NULL;
    }
    return port;
}

This issue shall document the problem in the implementation until a fix is available.

@mdjurfeldt @weidel-p FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant