Skip to content

wire not found for $posedge #192

@GyrosGeier

Description

@GyrosGeier

Completely different code for the other issue with the same title, so a separate issue. At least this one is nice and minimal.

library ieee;
use ieee.std_logic_1164.all;

entity test is
        port(
                clk, set, clear, reset : in std_logic;
                o : out std_logic
        );
end entity;

architecture rtl of test is
begin
        o <=
                '0'     when ?? reset else
                '1'     when (?? set) and rising_edge(clk) else
                '0'     when (?? clear) and rising_edge(clk);
end architecture;

This falls over with "wire not found for $posedge", while trying to connect the rising_edge as an input to an and, because the get_src function does not handle Id_PosEdge.

Writing this as

        o <=
                '0'                      when ?? reset else
                set or (o and not clear) when rising_edge(clk);

works, as do normal enables like

        addr_r <= addr when (?? valid) and rising_edge(clk);

so at least some variants of this are resolved by GHDL before they reach the GHDL YoSYS plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions