TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
ObjectInspection
(revision 3) (raw view)
Edit
Attach
Object Introspection in VHDL %TOC% ---++ Proposal Details * Who Updates: Jing Pang * Date Proposed: 2015-7-15 * Date Last Updated: 2015-7-15 * Priority: * Complexity: * Focus: ---+++ Current Situation WG meeting 2016-0907: reject - need more relevant examples <div> </div> <div> </div> <div id="_mcePaste">VHDL's attribute mechanism provides a introspection capability and provides access to simulation behavior.</div> <div id="_mcePaste">For example, the attribute of 'INSTANCE_NAME provides Hierarchical name of the entity.</div> <div id="_mcePaste">However, the attribute feature of VHDL has limited ability to determine the name and data types of</div> <div id="_mcePaste">data members in an object.</div> <div id="_mcePaste">Using introspection allows one design entity to dynamically dtermaine name and data type values of</div> <div id="_mcePaste">parameters in the design.</div> ---+++ Requirement Use a method "instanceof" combined with attribute, pointer and level of hierichy features for object instrospection. ---+++ Implementation details Syntax: 1). (intanceof(entity_name)'class_name->object_name, level_number) This returns '1' to represent the intropection success. This returns '0' to represent the intropection failure. 2). (intanceof(entity_name)'class_name->all, level_number) This displays all names Allowed class_name: port, architecture, signal, process, process_label, instance_label, function, procedure Level_number: 0 indicate current top hierarchical level; 1 indicate 1 level lower than the top hierarchical level; 2 indicate 2 levels lower than the top hiearchical level; etc. ---+++ Code Examples <pre>Half Adder: library ieee; use ieee.std_logic_1164.all; entity ha is port( a, b: in std_logic; cout, s: out std_logic); end ha; architecture dataflow of ha is begin s <= a xor b; cout <= a and b; end dataflow; Full Adder: library ieee; use ieee.std_logic_1164.all; entity fa is port( a, b, cin: in std_logic; cout, s: out std_logic); end fa; architecture fa_beh of fa is signal sm, p, q: std_logic; component ha port( a, b: in std_logic; cout, s: out std_logic); end component; begin u1: ha port map(a=>a, b=>b, cout=> p, s=> sm ); u2: ha port map(a=>sm, b=>cin, cout=> q, s=> s ); cout <= p or q; end fa_beh; Testbench for Full Adder Design: library ieee; use ieee.std_logic_1164.all; entity test_fa is end test_fa; architecture beh of test_fa is component fa port( a, b, cin: in std_logic; cout, s: out std_logic ); end component; signal a, b, cin, cout, s: std_logic; begin uut: fa port map( a => a, b=> b, cin=> cin, cout => cout, s=>s); process begin a <= '0'; b<='0'; cin <= '0'; wait for 10 ns; a <= '0'; b<='0'; cin <= '1'; wait for 10 ns; a <= '0'; b<='1'; cin <= '0'; wait for 10 ns; -- Pseudocodes are shown below --$display( intanceof(entity_name)'class_name->object_name, level_number ) --$display( intanceof(entity_name)'class_name->all, level_number ) -- Pseudocode $display(intanceof(fa)'port->a, 1); -- This resturns '1' to indicate a is a port for full adder $display(instanceof(test_fa)'instance_label->uut, 0); -- This resturns '1' to indicate uut is an instance label $display(instanceof(fa)'port->all, 1); -- This returns all port names of a, b, cin, cout, s. wait; end process; end beh; </pre> ---++ Use Cases Testbench Simulation, Design Verification, etc. ---++ Arguments FOR ---++ Arguments AGAINST ---++ General Comments ---++ Supporters _Add your signature here to indicate your support for the proposal_
Edit
|
Attach
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-02-17 - 15:34:35 -
TWikiGuest
P1076
Log In
or
Register
P1076 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Main
P1076
Ballots
LCS2016_080
P10761
P1647
P16661
P1685
P1734
P1735
P1778
P1800
P1801
Sandbox
TWiki
VIP
VerilogAMS
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback