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

Naming a signal "output" triggers a "custom attribute panicked" error message #29

Open
PoignardAzur opened this issue Jul 22, 2023 · 1 comment

Comments

@PoignardAzur
Copy link

Minimal reproduction:

#[derive(LogicBlock)]
struct NandGate {
    pub input_1: Signal<In, Bits<1>>,
    pub input_2: Signal<In, Bits<1>>,
    pub output: Signal<Out, Bits<1>>,
}

impl Logic for NandGate {
    #[hdl_gen]
    fn update(&mut self) {
        self.output.next = !(self.input_1.val() & self.input_2.val());
    }
}

This triggers the following error

error: custom attribute panicked
  --> src/level_nand.rs:24:5
   |
24 |     #[hdl_gen]
   |     ^^^^^^^^^^
   |
   = help: message: assertion failed: `(left != right)`
             left: `"output"`,
            right: `"output"`

Even if output is a reserved named and shouldn't be used, the error message should at least be more explicit.

@PoignardAzur
Copy link
Author

(Also happens when naming a signal "input")

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