mk said:
Then how are you supposed to prove that your rtl does the same thing
as the c code ? Instead of throwing away your c code, if you think
ahead and write your c code so that it resembles your datapth you can
dump the input, output of the c code and compare it with the rtl
implementation in your test-bench. This is especially easy if you use
fixed point in your c code so you can do bit-accurate comparisons.
Even with floating point, you can compare within an acceptable
error-range. In my opinion it is never a good idea to throw away
perfectly good design which can be re-used with some fore-thought.
Sure, but you're assuming the OP has C code written with eventual
conversion to VHDL in mind. With "foresight" you could even write COBOL
that resembles your datapath... (well maybe not COBOL, but you get my
point?)
You're lumping together two quite different problems here...
1. There is some 'proven' C code which someone wants to implement in
VHDL, or
2. The C code was written to prototype an algorithm, and can be used to
verify the VHDL implementation.
In the 1st instance, you have no choice about how the code was written.
And generally, this code is not going to be suitable for straight
conversion to VHDL.
In the 2nd instance, you do - but why would you bother? You're probably
better off in most cases doing a behavioural simultion in Verilog
straight away than bothering with C code. And you can gradually morph
your Verilog into a testbench for your synthesizable design.
Regards,
Mark