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

bsc ignores always_ready when checking for duplicate wires #657

Open
mieszko opened this issue Dec 27, 2023 · 0 comments
Open

bsc ignores always_ready when checking for duplicate wires #657

mieszko opened this issue Dec 27, 2023 · 0 comments
Labels
ICE Internal compiler error

Comments

@mieszko
Copy link
Collaborator

mieszko commented Dec 27, 2023

when bsc checks for duplicate wires (chkDupWires in ACheck) in the examples below, it fails with an ICE because (it claims) the RDY port name will appear twice — but the method is declared to be always_ready, so there shouldn't be a RDY port at all, and indeed if one of the method names is changed no RDY wires appear in the port declaration in the RTL.

example w/ an action method:

package Foo1 where

interface Foo =
    qux :: Bool -> Action {-# prefix = "", always_enabled, always_ready, arg_names = [fooqux] #-}

interface Bar =
    qux :: Bool -> Action {-# prefix = "", always_enabled, always_ready, arg_names = [barqux] #-}

interface Foobar =
    foo :: Foo {-# prefix = "" #-}
    bar :: Bar {-# prefix = "" #-}

{-# synthesize mkFoo1 #-}
mkFoo1 :: Module Foobar
mkFoo1 = return _

output:

acheck:chkDupWires
fromList [RDY_qux[IdPReady]]
Internal Bluespec Compiler Error:
Please report this failure to the BSC developers [...]

example w/ a value method:

package Foo2 where

interface Foo =
    qux :: Bool {-# prefix = "", always_enabled, always_ready, result = fooqux #-}

interface Bar =
    qux :: Bool {-# prefix = "", always_enabled, always_ready, result = barqux #-}

interface Foobar =
    foo :: Foo {-# prefix = "" #-}
    bar :: Bar {-# prefix = "" #-}

{-# synthesize mkFoo2 #-}
mkFoo2 :: Module Foobar
mkFoo2 = return _

output:

acheck:chkDupWires
fromList [RDY_qux[IdPReady]]
Internal Bluespec Compiler Error:
Please report this failure to the BSC developers [...]

interestingly, this doesn't seem to happen with the EN method in the first example, and the arg_names property appears to be respected — the value of all_names in chkDupWires is this:

[WILL_FIRE_bar_qux[IdPWillFire],WILL_FIRE_foo_qux[IdPWillFire],CAN_FIRE_bar_qux[IdPCanFire],CAN_FIRE_foo_qux[IdPCanFire],RDY_qux[IdPReady],RDY_qux[IdPReady],CLK,RST_N,fooqux,barqux]
@mieszko mieszko added the ICE Internal compiler error label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ICE Internal compiler error
Projects
None yet
Development

No branches or pull requests

1 participant