Returns true if both arguments represent the same compile-time object.
bool __equal_obj(any obj1, any obj2);
The __equal_obj() function allows comparing the foreach iterator or an object from a list with a given one. It is useful when writing generic list-based code.
class Class1
{
typedef logic[4] Type;
}
class Class2
{
typedef logic[8] Type;
const int Val = 5;
}
entity Test
{
generate dummy foreach(any c in __list(Class1, Class2))
{
generate inner if (!__equal_obj(c, Class1))
{
signal c.Type sig = c.Val;
}
}
}
generate_vhdl(Test);
Generated VHDL code:
entity Test is
end entity Test;
architecture Behavioral of Test is
signal dummy_1_inner_case_1_sig : std_logic_vector(7 downto 0) := X"05";
begin
end architecture Behavioral;