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

ERROR: wire not found for $posedge #146

Open
stevenbell opened this issue Mar 30, 2021 · 3 comments
Open

ERROR: wire not found for $posedge #146

stevenbell opened this issue Mar 30, 2021 · 3 comments

Comments

@stevenbell
Copy link

I've got a relatively simple code example with abnormal style which doesn't synthesize:

library IEEE;
use IEEE.std_logic_1164.all;

entity lfsr2 is
  port(
    clk : in std_logic;
    reset : in std_logic;
    b : out std_logic
  );
end lfsr2;



architecture synth of lfsr2 is


signal a : std_logic;
signal c : std_logic;

begin

  
process (clk) begin

    if reset = '1' then
        if rising_edge(clk) then
            b <= '1';
            c <= '1';
        end if;
    else
        if rising_edge(clk) then
            c <= a;
            b <= c;
        end if;
    end if;
    
end process;

a <= b xor c;

end;

Running yosys -m ghdl -p "ghdl --std=08 lfsr2; write_json netlist.json" gives:

 Yosys 0.9+3911 (git sha1 dcd9f0af, clang 7.0.1-8+deb10u2 -fPIC -Os)


-- Running command `ghdl --std=08 lfsr2; write_json netlist.json' --

1. Executing GHDL.
Importing module lfsr2.
ERROR: wire not found for $posedge

Currently using docker image (hdlc/ghdl - yosys - 189a1f80cd33).

@tgingold
Copy link
Member

tgingold commented Mar 30, 2021 via email

@stevenbell
Copy link
Author

I don't particularly care -- it works in Lattice LSE and Synplify, so it seems like it should synthesize. But a descriptive message that explains the error would be fine with me.

My use case is that this is the backend for vhdlweb.com (a VHDL coding practice website), where I've got dozens of students learning VHDL and trying all sorts of bad code. If code doesn't synthesize for some reason, I want to give them something that explains why.

@albydnc
Copy link

albydnc commented Apr 20, 2023

I have got the same error, is there a way to get a better error message? maybe locating the fault?
Thanks

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

3 participants