TWiki
>
P1076/Ballots Web
>
Vhdl2019CollectedRequirements
>
FileIo
(2020-02-17,
JimLewis
)
(raw view)
E
dit
A
ttach
---+ File IO / Textio updates %TOC% ---++ Proposal Editing Information * Who Updates: Main.JimLewis, <Add YourName>, ... * Date Proposed: 2012-08-18 * Date Last Updated: 2013-09-20 * Priority: * Complexity: * Focus: Testbench ---++ Requirement Summary Updates for textio procedures ---++ Related and/or Competing Issues: NONE ---++ Proposal ---+++ Decimal for std_logic_vector family Decimal read, write, and to_string for std_logic_vector, unsigned, signed, ufixed, sfixed, float, <verbatim>procedure DREAD (L : inout LINE; VALUE : out STD_ULOGIC_VECTOR; GOOD : out BOOLEAN); procedure DREAD (L : inout LINE; VALUE : out STD_ULOGIC_VECTOR); procedure DWRITE (L : inout LINE; VALUE : in STD_ULOGIC_VECTOR; JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0); function to_dstring(VALUE : in STD_ULOGIC_VECTOR) return string ; </verbatim> ---+++ Hexadecimal, Octal, and Binary for integer and real <verbatim>procedure HREAD (L : inout LINE; VALUE : out INTEGER; GOOD : out BOOLEAN); procedure HREAD (L : inout LINE; VALUE : out INTEGER); procedure OREAD (L : inout LINE; VALUE : out INTEGER; GOOD : out BOOLEAN); procedure OREAD (L : inout LINE; VALUE : out INTEGER); procedure BREAD (L : inout LINE; VALUE : out INTEGER; GOOD : out BOOLEAN); procedure BREAD (L : inout LINE; VALUE : out INTEGER); procedure DREAD (L : inout LINE; VALUE : out INTEGER; GOOD : out BOOLEAN); -- Default procedure DREAD (L : inout LINE; VALUE : out INTEGER); procedure HWRITE (L : inout LINE; VALUE : in INTEGER; JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0); procedure OWRITE (L : inout LINE; VALUE : in INTEGER; JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0); procedure BWRITE (L : inout LINE; VALUE : in INTEGER; JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0); procedure DWRITE (L : inout LINE; VALUE : in INTEGER; JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0); -- Default function to_hstring(L : integer) return string ; function to_ostring(L : integer) return string ; function to_bstring(L : integer) return string ; function to_dstring(L : integer) return string ; </verbatim> ---+++ SKIP_WHITESPACE Make the SKIP_WHITESPACE procedure in std.textio visible. <verbatim>procedure skip_whitespace ( L : inout LINE ) is variable readOk : BOOLEAN; variable c : CHARACTER; begin while L /= null and L.all'length /= 0 loop if (L.all(1) = ' ' or L.all(1) = NBSP or L.all(1) = HT) then read (l, c, readOk); else exit; end if; end loop; end procedure skip_whitespace;</verbatim> ---+++ "EndLine" Return true if line is empty. Note this requires the proposal [[FunctionInterface][Allow access type parameters on Function Interfaces]] <verbatim>function EndLine ( variable L : inout Line ) return boolean is variable Valid : boolean ; variable Char : character ; begin return L = null or L.all'length = 0 ; end function EndLine ; </verbatim> ---+++ "CommentLine" Leave Out: Return true if line is a comment line. Note this requires the proposal [[FunctionInterface][Allow access type parameters on Function Interfaces]] <verbatim>function CommentLine ( variable L : inout Line ) return boolean is variable Valid : boolean ; variable Char : character ; begin -- return Empty TRUE if line is null or 0 in length if L = null or L.all'length = 0 then return FALSE ; elsif L.all'length = 1 then return L.all(1) = '#' ; else return L.all(1) = '#' or (L.all(1) = '-' and L.all(2) = '-') ; end if ; end function CommentLine ;</verbatim> Consider adding other comments: //, /*, ;, ( ---+++ writeline - write directly to OUTPUT Write directly to file std.textio.OUTPUT. <verbatim>--?? procedure writeline(L : inout LINE); </verbatim> Add all stuff from OSVVM.TranscriptPkg? ---+++ FILE_REWIND (or REWIND) Move a read file pointer back to the beginning of the file. <verbatim>procedure FILE_REWIND (file F: FT); </verbatim> ---+++ FILE_SEEK (or SEEK) Move a read file pointer back to the beginning of the file. <pre>procedure FILE_REWIND (file F: FT; OFFSET : INTEGER; ORIGIN : ORIGIN_TYPE); type ORIGIN_TYPE is (BEGINNING, CURRENT, END) ; </pre> For a text file, it would be nice to do a separate seek for lines (needs to parse the file). ---+++ FILE_COPY_HANDLE (or COPY_HANDLE) Create a 2nd copy of a handle pointing to the current read location: <verbatim>procedure FILE_COPY_HANDLE (file F1, F2: FT); </verbatim> ---+++ Directory handling and Information Directory listing, date stamp, .... Perhaps some of this can be accessed through the DPI capability? [[http://www.eda.org/twiki/bin/view.cgi/P1076/DpiProposal]] ---++ Use Models ---++ Questions ---++ General Comments ---++ Supporters -- Main.MartinThompson - 2013-09-26 _Add your signature here to indicate your support for the proposal_
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r6
<
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r6 - 2020-02-17 - 15:34:53 -
JimLewis
P1076/Ballots
Log In
or
Register
P1076/Ballots 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback