[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: Icarus Verilog, convert_hex2ver and VPI



Hi at geda,

I have being using Icarus Verilog for a few days now and so far it looks
quite good.

However, I have hit a stumbling block.

I am trying to simulate various subsystems of a large design that is
targeted for an Altera device and I am using the Altera library
220model.v.

I am using an LPM_RAM_DP and it uses a PLI function called
$convert_hex2ver to initialise the memory.

The source for convert_hex2ver.c and 220model.v are freely available at
www.edif.org/lpmweb

Anyway I get the following error when I run vvp;

vvp test -mmyvpi

Error!  LPM_ROM must have data file for initialization.

ERROR: $readmemh parameter must be a constant
                   0:Error!  Invalid address.

Reset complete 
TESTING.............
Read transaction 1
Setting PCI vector with following parameters, id=1, count=01, index=001
byte_address=00000000
Waiting for target response
No target response after 00000011 cycles, terminating

I have not much exposure to PLI, VPI applications, yet.

I compile my vpi with the following command line

iverilog-vpi myvpi.c convert_hex2ver.c

Below is my myvpi.c

#include "vpi_user.h"

extern int convert_hex2ver();

static void register_convert()
{
    s_vpi_systf_data tf_data;

    tf_data.type    =   vpiSysTask;
    tf_data.tfname  =   "$convert_hex2ver";
    tf_data.calltf  =   convert_hex2ver;
    tf_data.compiletf =   0;
    tf_data.sizetf  =   0;

    vpi_register_systf( &tf_data );
}


void ( *vlog_startup_routines[] ) () = {
    register_convert,
    0
    };

Has anyone else succesfully done what I am trying to do ? Or can someone
point me in the right direction so I can solve this myself ?

thanks,
Tony Proudfoot.