marc said:
In some legacy code I found:
if (signal <= '1') then...
But the Xilinx ISE syntax check did NOT catch this.
Why? Is there a way to set it up to do so?
"<=" is overloadable. Reference the attached package.
There are two possible outcomes.
1: Compile time error: Older simulators do not allow explicit
implementations of subprograms to overload implicit ones (newer ones do).
2: Run time warning due to code in package.
Option 2: Make a copy of the attached package under a different
name and reference both packages in the design - the result
is a compile time error flagging the operator.
Have fun,
Jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:
[email protected]
SynthWorks Design Inc.
http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
-- File Name: munge_le_pkg.vhd
-- Block Name: munge_le_pkg
--
-- Author: Jim Lewis, SynthWorks Design Inc, 503-590-4787
--
-- Creation Date: 10/2006
--
-- Description:
-- Testbench munge_le_pkg
--
-- Project:
-- SynthWorks Design Inc.
-- Training Courses
-- 11898 SW 128th Ave.
-- Tigard, Or 97223
--
http://www.SynthWorks.com
-- email: (e-mail address removed)
--
-- Copyright (c) 2006 by SynthWorks Design Inc. All rights reserved.
--
-- $Id: $
--
-- $Revision: $
--
-- Revision History:
-- $Log: $
--
-- Known Bugs:
-- None
--
library ieee;
use ieee.std_logic_1164.all;
package munge_le_pkg is
function "<=" (L, R: std_ulogic) return boolean ;
end munge_le_pkg ;
package body munge_le_pkg is
type bool_table is array(std_ulogic, std_ulogic) of boolean ;
constant F : boolean := false ;
constant T : boolean := true ;
CONSTANT le_table : bool_table := (
-- -------------------------------------------------
-- | U X 0 1 Z W L H - | |
-- -------------------------------------------------
( F, F, F, F, F, F, F, F, F ), -- | U |
( F, F, F, F, F, F, F, F, F ), -- | X |
( F, F, T, T, F, F, T, T, F ), -- | 0 |
( F, F, F, T, F, F, F, T, F ), -- | 1 |
( F, F, F, F, F, F, F, F, F ), -- | Z |
( F, F, F, F, F, F, F, F, F ), -- | W |
( F, F, T, T, F, F, T, T, F ), -- | L |
( F, F, F, T, F, F, F, T, F ), -- | H |
( F, F, F, T, F, F, F, T, F ) -- | - |
);
function "<=" (L, R: std_ulogic) return boolean is
begin
report "Suspect usage of <= with std_ulogic" severity warning ;
return le_table(L, R) ;
end "<=" ;
end munge_le_pkg ;