207 lines
7.7 KiB
Plaintext
207 lines
7.7 KiB
Plaintext
PCK_FIO.out: TESTBENCH OUTPUT FOR PCK_FIO
|
|
-----------------------------------------
|
|
|
|
This is the result of running the PCK_FIO testbench.
|
|
This file should be compared with PCK_FIO.out.gold, which is
|
|
the reference output. Any difference indicates a portability
|
|
issue or a simulator non-compliance or bug.
|
|
|
|
|
|
--------------------
|
|
-- Basic features --
|
|
--------------------
|
|
|
|
-- First some auxiliary declarations
|
|
> file RESULT: text is out "PCK_FIO.out";
|
|
> variable L: line;
|
|
> variable BoolTrue: boolean := TRUE;
|
|
> variable BoolFalse: boolean := FALSE;
|
|
> variable IntPos: integer := 5678;
|
|
> variable BigIntPos: integer := 12345678;
|
|
> variable IntNeg: integer := -8765;
|
|
> variable BigIntNeg: integer := -87654321;
|
|
> variable Uns: unsigned(6 downto 0) := unsigned'("1010010");
|
|
> variable Unk: unsigned(6 downto 0) := unsigned'("1X10Z10");
|
|
> variable Std: std_logic_vector(6 downto 0) := std_logic_vector'("0010010");
|
|
> variable SigPos: signed(6 downto 0) := signed'("0010010");
|
|
> variable SigNeg: signed(6 downto 0) := signed'("1010010");
|
|
> variable BitX: std_logic := 'X';
|
|
> variable Bit1: std_logic := '1';
|
|
> variable Bit0: std_logic := '0';
|
|
|
|
|
|
-- fprint call with no arguments
|
|
> fprint(RESULT, L, "No arguments.\n);"
|
|
No arguments.
|
|
|
|
-- Special characters need to be escaped
|
|
> fprint(RESULT, L, "Special characters: \% \\ " \n");
|
|
Special characters: % \ "
|
|
|
|
-- Various format specifiers interprete the same object differently
|
|
> fprint(RESULT, L, "Format specifiers: %r %d %b %q\n);"
|
|
> fo(Uns), fo(Uns), fo(Uns), fo(Uns)
|
|
> );
|
|
Format specifiers: 0x52 82 1010010 U:1010010
|
|
|
|
-- Format string can be shortened by using the iteration specifier
|
|
> fprint(RESULT, L, "Iteration specifier: %4{%r }\n);"
|
|
> fo(Uns), fo(SigPos), fo(SigNeg), fo(Std)
|
|
> );
|
|
Iteration specifier: 0x52 0x12 0x52 0x12
|
|
|
|
------------------------------------
|
|
-- Support for bit-oriented types --
|
|
------------------------------------
|
|
|
|
-- Reasonable format
|
|
> fprint(RESULT, L, "Reasonable format: %9{%r }\n",
|
|
> fo(Std), fo(Uns), fo(SigPos), fo(SigNeg), fo(Unk),
|
|
> fo(Bit1), fo(BitX), fo(BoolTrue), fo(BoolFalse)
|
|
> );
|
|
Reasonable format: 0x12 0x52 0x12 0x52 0x?? 1 X T F
|
|
|
|
-- Decimal format
|
|
> fprint(RESULT, L, "Decimal format: %7{%d }\n",
|
|
> fo(Std), fo(Uns), fo(SigPos), fo(SigNeg), fo(Unk),
|
|
> fo(Bit1), fo(BitX), fo(BoolTrue), fo(BoolFalse)
|
|
> );
|
|
Decimal format: 18 82 18 -46 -1 1 -1 1 0
|
|
|
|
-- Bit format
|
|
> fprint(RESULT, L, "Bit format: %7{%b }\n",
|
|
> fo(Std), fo(Uns), fo(SigPos), fo(SigNeg), fo(Unk),
|
|
> fo(Bit1), fo(BitX), fo(BoolTrue), fo(BoolFalse)
|
|
> );
|
|
Bit format: 0010010 1010010 0010010 1010010 1X10Z10 1 X 1 0
|
|
|
|
|
|
-- Alignment
|
|
-- Template of the call: (<fs> stands for the format specifier)
|
|
|
|
> fprint(RESULT, L, "Bitvectors with <fs>: %4{<fs>|}\n",
|
|
> fo(Std), fo(Uns), fo(SigPos), fo(SigNeg)
|
|
> );
|
|
|
|
-- Results of the call with various format specifiers
|
|
|
|
Bitvectors with %1r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %2r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %3r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %4r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %5r: 0x52| 0x12| 0x12| 0x52|
|
|
Bitvectors with %6r: 0x52| 0x12| 0x12| 0x52|
|
|
Bitvectors with %7r: 0x52| 0x12| 0x12| 0x52|
|
|
Bitvectors with %8r: 0x52| 0x12| 0x12| 0x52|
|
|
Bitvectors with %9r: 0x52| 0x12| 0x12| 0x52|
|
|
|
|
Bitvectors with %-1r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %-2r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %-3r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %-4r: 0x52|0x12|0x12|0x52|
|
|
Bitvectors with %-5r: 0x52 |0x12 |0x12 |0x52 |
|
|
Bitvectors with %-6r: 0x52 |0x12 |0x12 |0x52 |
|
|
Bitvectors with %-7r: 0x52 |0x12 |0x12 |0x52 |
|
|
Bitvectors with %-8r: 0x52 |0x12 |0x12 |0x52 |
|
|
Bitvectors with %-9r: 0x52 |0x12 |0x12 |0x52 |
|
|
|
|
Bitvectors with %1d: 82|18|18|-46|
|
|
Bitvectors with %2d: 82|18|18|-46|
|
|
Bitvectors with %3d: 82| 18| 18|-46|
|
|
Bitvectors with %4d: 82| 18| 18| -46|
|
|
Bitvectors with %5d: 82| 18| 18| -46|
|
|
Bitvectors with %6d: 82| 18| 18| -46|
|
|
Bitvectors with %7d: 82| 18| 18| -46|
|
|
Bitvectors with %8d: 82| 18| 18| -46|
|
|
Bitvectors with %9d: 82| 18| 18| -46|
|
|
|
|
Bitvectors with %-1d: 82|18|18|-46|
|
|
Bitvectors with %-2d: 82|18|18|-46|
|
|
Bitvectors with %-3d: 82 |18 |18 |-46|
|
|
Bitvectors with %-4d: 82 |18 |18 |-46 |
|
|
Bitvectors with %-5d: 82 |18 |18 |-46 |
|
|
Bitvectors with %-6d: 82 |18 |18 |-46 |
|
|
Bitvectors with %-7d: 82 |18 |18 |-46 |
|
|
Bitvectors with %-8d: 82 |18 |18 |-46 |
|
|
Bitvectors with %-9d: 82 |18 |18 |-46 |
|
|
|
|
|
|
-------------------------------
|
|
-- Support for integer types --
|
|
-------------------------------
|
|
|
|
|
|
-- Template of the call: (<fs> stands for the format specifier)
|
|
|
|
> fprint(RESULT, L, "Integers with <fs>: %4{<fs>|}\n",
|
|
> fo(IntPos), fo(IntNeg), fo(BigIntPos), fo(BigIntNeg)
|
|
> );
|
|
|
|
-- Results of the call with various format specifiers
|
|
|
|
Integers with %5d: 5678|-8765|12345678|-87654321|
|
|
Integers with %6d: 5678| -8765|12345678|-87654321|
|
|
Integers with %7d: 5678| -8765|12345678|-87654321|
|
|
Integers with %8d: 5678| -8765|12345678|-87654321|
|
|
Integers with %9d: 5678| -8765| 12345678|-87654321|
|
|
Integers with %10d: 5678| -8765| 12345678| -87654321|
|
|
|
|
Integers with %-5d: 5678 |-8765|12345678|-87654321|
|
|
Integers with %-6d: 5678 |-8765 |12345678|-87654321|
|
|
Integers with %-7d: 5678 |-8765 |12345678|-87654321|
|
|
Integers with %-8d: 5678 |-8765 |12345678|-87654321|
|
|
Integers with %-9d: 5678 |-8765 |12345678 |-87654321|
|
|
Integers with %-10d: 5678 |-8765 |12345678 |-87654321 |
|
|
|
|
Integers with %5r: 5678|-8765| 5678|-4321|
|
|
Integers with %6r: 5678|- 8765| 45678|-54321|
|
|
Integers with %7r: 5678|- 8765| 345678|-654321|
|
|
Integers with %8r: 5678|- 8765| 2345678|-7654321|
|
|
Integers with %9r: 5678|- 8765| 12345678|-87654321|
|
|
Integers with %10r: 5678|- 8765| 12345678|- 87654321|
|
|
|
|
Integers with %-5r: 5678|-8765| 1234|-8765|
|
|
Integers with %-6r: 5678 |-8765 | 12345|-87654|
|
|
Integers with %-7r: 5678 |-8765 | 123456|-876543|
|
|
Integers with %-8r: 5678 |-8765 | 1234567|-8765432|
|
|
Integers with %-9r: 5678 |-8765 | 12345678|-87654321|
|
|
Integers with %-10r: 5678 |-8765 | 12345678 |-87654321 |
|
|
|
|
|
|
----------------------
|
|
-- Support for time --
|
|
----------------------
|
|
-- For portability reasons, time is converted
|
|
-- into an integer value (of nanoseconds)
|
|
> wait for 648 ns
|
|
> fprint (RESULT, L, "The time is now %d ns\n", fo(now));
|
|
The time is now 648 ns
|
|
|
|
----------------------------------------
|
|
-- Erroneous calls and error messages --
|
|
----------------------------------------
|
|
|
|
-- Less arguments than formats specifiers
|
|
> fprint(RESULT, L, "%d %d %d %d \n", fo(Uns), fo(Std));
|
|
82 18
|
|
** Warning: FIO_PrintLastValue: Format specifier beyond last argument
|
|
** in format string: "%d %d %d %d \n"
|
|
** ------^
|
|
|
|
-- Unsupported format specifier
|
|
> fprint(RESULT, L, "%r %v %r %r\n", fo(Uns), fo(Std), fo(Uns), fo(Std));
|
|
0x52
|
|
** Warning: FIO_PrintArg: Unexpected format specifier 'v'
|
|
** in format string: "%r %v %r %r\n"
|
|
** ----^
|
|
** Assuming 'q' to proceed: V:0010010 0x52 0x12
|
|
|
|
|
|
----------------------------------------
|
|
-- Things you wouldn't expect to work --
|
|
----------------------------------------
|
|
|
|
-- Nested iteration
|
|
> fprint(RESULT, L, "%3{<<%3{_END_}>>}\n");
|
|
<<_END__END__END_>><<_END__END__END_>><<_END__END__END_>>
|