On Mon, 14 Feb 2011 19:40:01 +0100, Lluís Batlle i Rossell <[email protected]> wrote:
On Mon, Feb 14, 2011 at 06:01:49PM +0100, [email protected] wrote:
On Mon, 14 Feb 2011 17:48:59 +0100, Lluís Batlle i Rossell
<[email protected]> wrote:
>>I just put the sources at http://ygdes.com/GHDL/int_bool
>>run sha-1.sh after editing the top of sha-1.vhdl
>>to suite one of the 4 options.
>Also additions could be done that way, isn't it?
they are done already :-)
+, -, *, /, exp and mod are available.
I added and/or/not/nand/nor/xor/xnor,
shift and rotate. The microbenchmark is
a SHA-1 kernel that makes use of most of these
with 32-bit variables : no wonder the speedup
is that good.
Then, GHDL ends up producing some intermediate code as if it had been written
for a computer with a 1-bit ALU, or I understand it wrong?

in what case ?

GHDL considers the type "std_ulogic_vector" as an array of byte-sized values,
which is the normal way, but it's slow, since each array access
implies address computation and verification.
It's very slow, takes quite a lot of room but it's precise and very safe.

Using integers for common "high-level" operation is much faster,
but VHDL does not allow boolean operations on integers :-/
This does not allow behavioural simulation of certain classes of
circuits that interest me so I made a package that "overloads"
the boolean operations for integers (and goes through small
chunks of C-written code). That's the easiest and smallest i could
do without touching the compiler.

My idea is not to replace std_ulogic_vector because it's needed
for acurate simulation and synthesis, but to add a new ability
to the language. I use an intermediary type that is mapped to
either integer or std_ulogic_vector so i can have either speed
or synthesis :-)

Look at the files in http://ygdes.com/GHDL/int_bool :
 * the integer operations (and operator overload) are defined
    in int_ops.vhdl and int_ops.c
 * the intermediary type is defined in either one of these files :
    int_bitvector.vhdl, int_integer_range.vhdl, int_integer.vhdl
    or int_sulv.vhdl
 * a microbenchmark is in sha-1.vhdl
 * minimal example code is in test_bool.vhdl

tell me what you think :-)

yg


_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to