2010-10-11 06:52:26 +02:00
|
|
|
#ifndef __array_H
|
2007-01-18 01:24:10 +01:00
|
|
|
#define __array_H
|
|
|
|
|
/*
|
2010-10-14 22:47:40 +02:00
|
|
|
* Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com)
|
2007-01-18 01:24:10 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-08-29 03:41:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2007-01-18 01:24:10 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "vvp_net.h"
|
|
|
|
|
#include "vpi_user.h"
|
|
|
|
|
|
|
|
|
|
typedef struct __vpiArray* vvp_array_t;
|
2012-02-02 19:49:59 +01:00
|
|
|
class value_callback;
|
2007-01-18 01:24:10 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This function tries to find the array (by label) in the global
|
|
|
|
|
* table of all the arrays in the design.
|
|
|
|
|
*/
|
2008-05-17 04:06:12 +02:00
|
|
|
extern vvp_array_t array_find(const char*label);
|
2008-09-18 22:44:54 +02:00
|
|
|
extern unsigned get_array_word_size(vvp_array_t array);
|
2007-12-03 18:44:31 +01:00
|
|
|
extern vpiHandle array_index_iterate(int code, vpiHandle ref);
|
2007-01-18 01:24:10 +01:00
|
|
|
|
|
|
|
|
extern void array_word_change(vvp_array_t array, unsigned long addr);
|
|
|
|
|
|
2009-09-07 06:35:08 +02:00
|
|
|
extern void array_attach_word(vvp_array_t array, unsigned addr, vpiHandle word);
|
2008-03-20 21:07:18 +01:00
|
|
|
extern void array_alias_word(vvp_array_t array, unsigned long addr,
|
2010-10-14 22:47:40 +02:00
|
|
|
vpiHandle word, int msb, int lsb);
|
2007-01-18 01:24:10 +01:00
|
|
|
|
2008-11-02 04:44:03 +01:00
|
|
|
extern void array_set_word(vvp_array_t arr, unsigned idx,
|
|
|
|
|
unsigned off, vvp_vector4_t val);
|
|
|
|
|
extern void array_set_word(vvp_array_t arr, unsigned idx,
|
|
|
|
|
double val);
|
2007-01-18 01:24:10 +01:00
|
|
|
|
2008-06-12 19:04:29 +02:00
|
|
|
extern vvp_vector4_t array_get_word(vvp_array_t array, unsigned address);
|
2008-11-02 04:44:03 +01:00
|
|
|
extern double array_get_word_r(vvp_array_t array, unsigned address);
|
2007-01-18 01:24:10 +01:00
|
|
|
|
2008-05-21 03:30:56 +02:00
|
|
|
/* VPI hooks */
|
|
|
|
|
|
2012-02-02 19:49:59 +01:00
|
|
|
extern value_callback* vpip_array_word_change(p_cb_data data);
|
|
|
|
|
extern value_callback* vpip_array_change(p_cb_data data);
|
2008-05-21 03:30:56 +02:00
|
|
|
|
|
|
|
|
/* Compile hooks */
|
2007-12-03 20:41:52 +01:00
|
|
|
extern void compile_varw_real(char*label, vvp_array_t array,
|
2007-04-10 03:26:15 +02:00
|
|
|
unsigned long array_addr,
|
|
|
|
|
int msb, int lsb);
|
2007-01-18 01:24:10 +01:00
|
|
|
#endif
|