FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal


Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-05-2008, 04:21 PM
Nicolas Hervé
Posts: n/a
Default [VPI] read and write values of register arrays ?

Hi all !

I am wondering how to access (write and read) a register array passed
as parameter to my vpi function.

/* in file cosimu.v */

reg [7:0] my_reg_array [0:3][0:3];


Here is the resume (dummy) code that I have.

/* Write value to reg array */
int random(char *userdata)

/* get handles ... */
systfref, // handle on current function
args_iter, // handle to iterate on arguments
argh, // handles on arguments
var_name; // handles on variable names

/* structures for input arguments */
struct t_vpi_value argval;

/* Obtain a handle to the argument list */
systfref = vpi_handle(vpiSysTfCall, NULL);

/* get first handle of function args */
args_iter = vpi_iterate(vpiArgument, systfref);

argh = vpi_scan(args_iter);

/* getting iterator on Verilog data to fill */
argval.format = vpiRegArray;

How can I continue here to iterate on the values ? */

return 0;
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Register to register read Ani Verilog 1 12-13-2006 05:41 PM
how to write tri-state bus in rtl [email protected] Verilog 2 07-31-2006 03:17 PM
Verilog -SRAM to be able to Read and Write SDRAM Vick Verilog 1 11-09-2004 04:36 PM
Trying to monitor output of a register instantiates another register seanadams Verilog 1 02-11-2004 06:13 PM
When to read a configuration register? Uwe Stange Verilog 1 10-07-2003 09:50 AM

All times are GMT +1. The time now is 03:49 AM.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved