Skip to content

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

Description

@PoignardAzur

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions