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

Re: gEDA-user: Icarus Verilog, convert_hex2ver and VPI



Dear Tony:
    I would imagine your model is looking for a file for readmemh with the
ram ram initialization contents as its argument. I can see in 220cells-1.pdf
where one of the properties of the LPM_ROM model is a required LPM_File to
initialize the ROM. You need to study your model a bit more and figure out
what it wants exactly and supply it. This is a model issue, not an Icarus
Verilog issue. I will be studying some of the other LPM models this morning
for a while, please let me know your progress and if I figure out your
readmemh format first, I will let you know.

Charles


----- Original Message -----
From: "Tony Proudfoot" <tonyp@platypus.net>
To: <geda-user@geda.seul.org>
Sent: Thursday, May 22, 2003 8:18 PM
Subject: 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.