[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] vanilla vs simili



On Thu, Sep 13, 2001 at 07:57:02PM +0200, Yann Guidon wrote:
[...]
> Simili gave me a surprise : first, it deals with bytes.
> at least, this is what the old version i use does.
> I think that it gives a little insight in how simili
> works internally. I tried to raw-"write" some structures
> and a std_ulogic_vector(N downto 0) outputs N bytes (not N-1).

That should better be N+1...

One byte per (std_ulogic) bit is ok, since std_ulogic can have 9 values.
A packed (2 std_ulogic bits per byte) format would save some space but
is harder to handle.

> Second, given a binary input, it stops after N bytes.
> I compared the hexdump of the input and the output :
> input  : 68 FF 7E
> output : 68 68
> (that is : where the output stopped). I fear that it can be
> worse that i thought. Well i SHOULD update my local copy of
> simili. Maybe it was fixed long ago. But stopping on a 0xFF
> is not a good sign for a C program. I know : Simili is written
> in C++ and i don't know a damn about it. So i will let
> the experts discuss about it.

C/C++ programs stopping at 0xff usually suffer from the `getc() return
type' problem (some programmers use C stdio in C++).  But it could also
be the C runtime library (getc() returning negative values if the char
value goes beyond 127, which makes EOF and (char)255 indistinguishable).
But I'm not a Windoze Quirks Expert (tm)...

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/