From 5ac1f1eba35fec83789c635b7b145474a77a5fde Mon Sep 17 00:00:00 2001 From: Rodrigo Alejandro Melo Date: Fri, 1 Dec 2017 13:25:14 -0300 Subject: Added unsupported things to todo.vhd Applied a workaround in examples/Makefile to solve a dependency problem. --- examples/Makefile | 1 + examples/todo.vhd | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 1d1399d..2ef61d3 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -6,6 +6,7 @@ all: ifneq ($(shell which ghdl),) @mkdir -p $(TEMP) @echo "##### Checking examples with GHDL ##############################" + ghdl -a --workdir=$(TEMP) signextend.vhd ghdl -a --workdir=$(TEMP) *.vhd endif diff --git a/examples/todo.vhd b/examples/todo.vhd index 79b3e59..bd9e81f 100644 --- a/examples/todo.vhd +++ b/examples/todo.vhd @@ -3,6 +3,10 @@ use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity todo is + generic( + INBYLEVEL : boolean:=FALSE + --DEB_TIME : real:=50.0e-3 -- unexpected NAME, expecting ')' at "e" + ); port ( clk_i : in std_logic; data_i : in std_logic_vector(7 downto 0); @@ -16,6 +20,19 @@ architecture rtl of todo is signal int : integer; signal uns : unsigned(7 downto 0); + + -- unexpected NAME at "rem" + --constant VALUE : positive := 9 rem 2; + + constant BYTES : positive:=4; + constant WIDTH : positive:=BYTES*8; + signal index : natural range 0 to BYTES-1; + signal comma : std_logic_vector(BYTES*3-1 downto 0); + + -- (others => (others => '0')) must be replaced by an initial block with a for + -- or something similar. + type ff_array is array (0 to 255) of std_logic_vector(7 downto 0); + signal data_r : ff_array :=(others => (others => '0')); begin --************************************************************************** -- Wrong translations @@ -31,7 +48,18 @@ begin end if; end loop; end process test_i; - + -- indexed part-select not applied + do_boundary: process (clk_i) + begin + if rising_edge(clk_i) then + for i in 0 to BYTES-1 loop + if comma(BYTES*2+i-1 downto BYTES+i)=comma(3 downto 0) then + index <= i; + end if; + end loop; + end if; + end process; + comma <= comma(BYTES+index-1 downto index); --************************************************************************** -- Translations which abort with syntax error (uncomment to test) --************************************************************************** @@ -42,5 +70,11 @@ begin -- i => "00000000" & X"11", -- But here fail -- o => open -- ); - + -- unexpected NAME, expecting WHEN or ';' + --int <= 9 rem 2; + -- Unsupported generate with boolean? +-- in_by_level: +-- if INBYLEVEL generate +-- int <= 9; +-- end generate in_by_level; end rtl; -- cgit v1.2.1