Skip to content

Commit

Permalink
Add testcase for issue17.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed Jan 16, 2016
1 parent 929fc2f commit c3c11ed
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
30 changes: 30 additions & 0 deletions testsuite/gna/issue17/cond_assign_proc.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
library ieee ;
use ieee.std_logic_1164.all ;
use std.textio.all ;

entity cond_assign_proc is
end entity cond_assign_proc ;
architecture doit of cond_assign_proc is
signal Clk : std_logic := '0' ;
signal Y : std_logic ;
begin
Clk <= not Clk after 10 ns ;

process (Clk)
variable A : std_logic ;
begin
A := 'H' when Clk = '1' else 'L' ;
Y <= A ;
-- Y <= 'H' when Clk = '1' else 'L' ;
end process ;

-- Y <= 'H' when Clk = '1' else 'L' ;

process
begin
wait for 500 ns ;
std.env.stop ;
end process ;
end architecture doit ;


28 changes: 28 additions & 0 deletions testsuite/gna/issue17/cond_assign_sig.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
library ieee ;
use ieee.std_logic_1164.all ;
use std.textio.all ;

entity cond_assign_sig is
end entity cond_assign_sig ;

architecture doit of cond_assign_sig is
signal Clk : std_logic := '0' ;
signal Y : std_logic ;
begin
Clk <= not Clk after 10 ns ;

process (Clk)
begin
Y <= 'H' when Clk = '1' else 'L' ;
end process ;

-- Y <= 'H' when Clk = '1' else 'L' ;

process
begin
wait for 500 ns ;
std.env.stop ;
end process ;
end architecture doit ;


31 changes: 31 additions & 0 deletions testsuite/gna/issue17/cond_assign_var.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
library ieee ;
use ieee.std_logic_1164.all ;
use std.textio.all ;

entity cond_assign_var is
end entity cond_assign_var ;

architecture doit of cond_assign_var is
signal Clk : std_logic := '0' ;
signal Y : std_logic ;
begin
Clk <= not Clk after 10 ns ;

process (Clk)
variable A : std_logic ;
begin
A := 'H' when Clk = '1' else 'L' ;
Y <= A ;
-- Y <= 'H' when Clk = '1' else 'L' ;
end process ;

-- Y <= 'H' when Clk = '1' else 'L' ;

process
begin
wait for 500 ns ;
std.env.stop ;
end process ;
end architecture doit ;


17 changes: 17 additions & 0 deletions testsuite/gna/issue17/testsuite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/sh

. ../../testenv.sh

GHDL_STD_FLAGS=--std=08
analyze cond_assign_var.vhdl
elab_simulate cond_assign_var

analyze cond_assign_sig.vhdl
elab_simulate cond_assign_sig

analyze cond_assign_proc.vhdl
elab_simulate cond_assign_proc

clean

echo "Test successful"

0 comments on commit c3c11ed

Please sign in to comment.