support fast programming by only writing the bits

that are listed in the input file.
This commit is contained in:
steve 2001-06-30 23:03:16 +00:00
parent 3b82a15521
commit ab7b353ace
13 changed files with 122 additions and 16 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: ivl_target.h,v 1.69 2001/06/19 03:01:10 steve Exp $"
#ident "$Id: ivl_target.h,v 1.70 2001/06/30 23:03:16 steve Exp $"
#endif
#ifdef __cplusplus
@ -317,12 +317,17 @@ typedef int (ivl_scope_f)(ivl_scope_t net, void*cd);
* A design has a root named scope that is an instance of the top
* level module in the design. This is a hook for naming the
* design, or for starting the scope scan.
*
* ivl_design_time_precision
* A design as a time precision. This is the size in seconds (a
* signed power of 10) of a simulation tick.
*/
extern const char* ivl_design_flag(ivl_design_t des, const char*key);
extern int ivl_design_process(ivl_design_t des,
ivl_process_f fun, void*cd);
extern ivl_scope_t ivl_design_root(ivl_design_t des);
extern int ivl_design_time_precision(ivl_design_t des);
/*
* These methods apply to ivl_net_const_t objects.
@ -884,6 +889,10 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.70 2001/06/30 23:03:16 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.69 2001/06/19 03:01:10 steve
* Add structural EEQ gates (Stephan Boettcher)
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll-api.cc,v 1.51 2001/06/16 23:45:05 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.52 2001/06/30 23:03:16 steve Exp $"
#endif
# include "t-dll.h"
@ -47,6 +47,11 @@ extern "C" ivl_scope_t ivl_design_root(ivl_design_t des)
return des->root_;
}
extern "C" int ivl_design_time_precision(ivl_design_t des)
{
return des->time_precision;
}
extern "C" ivl_expr_type_t ivl_expr_type(ivl_expr_t net)
{
if (net == 0)
@ -1227,6 +1232,10 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.52 2001/06/30 23:03:16 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.51 2001/06/16 23:45:05 steve
* Add support for structural multiply in t-dll.
* Add code generators and vvp support for both

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.cc,v 1.51 2001/06/19 03:01:10 steve Exp $"
#ident "$Id: t-dll.cc,v 1.52 2001/06/30 23:03:16 steve Exp $"
#endif
# include "compiler.h"
@ -318,6 +318,7 @@ bool dll_target::start_design(const Design*des)
// Initialize the design object.
des_.self = des;
des_.time_precision = des->get_precision();
des_.root_ = new struct ivl_scope_s;
des_.root_->name_ = strdup(des->find_root_scope()->name().c_str());
des_.root_->child_ = 0;
@ -1381,6 +1382,10 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.52 2001/06/30 23:03:16 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.51 2001/06/19 03:01:10 steve
* Add structural EEQ gates (Stephan Boettcher)
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.h,v 1.51 2001/06/30 21:07:26 steve Exp $"
#ident "$Id: t-dll.h,v 1.52 2001/06/30 23:03:16 steve Exp $"
#endif
# include "target.h"
@ -38,6 +38,8 @@ typedef shl_t ivl_dll_t;
struct ivl_design_s {
int time_precision;
ivl_scope_t root_;
ivl_process_t threads_;
@ -539,6 +541,10 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.52 2001/06/30 23:03:16 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.51 2001/06/30 21:07:26 steve
* Support non-const right shift (unsigned).
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vvp.c,v 1.8 2001/05/22 02:14:47 steve Exp $"
#ident "$Id: vvp.c,v 1.9 2001/06/30 23:03:16 steve Exp $"
#endif
/*
@ -71,6 +71,15 @@ int target_design(ivl_design_t des)
draw_execute_header(des);
{ int pre = ivl_design_time_precision(des);
char sign = '+';
if (pre < 0) {
pre = -pre;
sign = '-';
}
fprintf(vvp_out, ":vpi_time_precision %c %d;\n", sign, pre);
}
draw_module_declarations(des);
root = ivl_design_root(des);

View File

@ -1,7 +1,7 @@
/*
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
*
* $Id: README.txt,v 1.31 2001/06/18 00:51:23 steve Exp $
* $Id: README.txt,v 1.32 2001/06/30 23:03:16 steve Exp $
*/
VVP SIMULATION ENGINE
@ -47,6 +47,18 @@ the rest of the program is compiled. The compiler looks in the
standard VPI_MODULE_PATH for files named "name.vpi", and tries to
dynamic load them.
* :vpi_time_precision [+|-]<value>;
This header statement specifies the time precision of a single tick of
the simulation clock. This is mostly used for display (and VPI)
purposes, because the engine itself does not care about units. The
compiler scales time values ahead of time.
The value is the size of a simulation tick in seconds, and is
expressed as a power of 10. For example, +0 is 1 second, and -9 is 1
nano-second. If the record is left out, then the precision is taken to
be +0.
LABELS AND SYMBOLS
Labels and symbols consist of the characters:

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: compile.cc,v 1.82 2001/06/30 21:07:26 steve Exp $"
#ident "$Id: compile.cc,v 1.83 2001/06/30 23:03:16 steve Exp $"
#endif
# include "arith.h"
@ -245,6 +245,11 @@ void compile_load_vpi_module(char*name)
free(name);
}
void compile_vpi_time_precision(long pre)
{
vpip_set_time_precision(pre);
}
/*
* Add a functor to the symbol table
*/
@ -1450,6 +1455,10 @@ vvp_ipoint_t debug_lookup_functor(const char*name)
/*
* $Log: compile.cc,v $
* Revision 1.83 2001/06/30 23:03:16 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.82 2001/06/30 21:07:26 steve
* Support non-const right shift (unsigned).
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: compile.h,v 1.28 2001/06/16 23:45:05 steve Exp $"
#ident "$Id: compile.h,v 1.29 2001/06/30 23:03:17 steve Exp $"
#endif
# include <stdio.h>
@ -48,6 +48,8 @@ extern unsigned compile_errors;
extern const char* module_path;
extern void compile_load_vpi_module(char*name);
extern void compile_vpi_time_precision(long pre);
/*
* This function is called by the parser to compile a functor
* statement. The strings passed in are allocated by the lexor, but
@ -198,6 +200,10 @@ extern void compile_net(char*label, char*name,
/*
* $Log: compile.h,v $
* Revision 1.29 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.28 2001/06/16 23:45:05 steve
* Add support for structural multiply in t-dll.
* Add code generators and vvp support for both

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: lexor.lex,v 1.23 2001/06/18 03:10:34 steve Exp $"
#ident "$Id: lexor.lex,v 1.24 2001/06/30 23:03:17 steve Exp $"
#endif
# include "parse_misc.h"
@ -32,6 +32,7 @@
/* These are some special header keywords. */
^":vpi_module" { return K_vpi_module; }
^":vpi_time_precision" { return K_vpi_time_precision; }
/* A label is any non-blank text that appears left justified. */
@ -145,6 +146,10 @@ int yywrap()
/*
* $Log: lexor.lex,v $
* Revision 1.24 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.23 2001/06/18 03:10:34 steve
* 1. Logic with more than 4 inputs
* 2. Id and name mangling

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: parse.y,v 1.32 2001/06/16 23:45:05 steve Exp $"
#ident "$Id: parse.y,v 1.33 2001/06/30 23:03:17 steve Exp $"
#endif
# include "parse_misc.h"
@ -60,7 +60,7 @@ extern FILE*yyin;
%token K_UDP K_UDP_C K_UDP_S
%token K_MEM K_MEM_P K_MEM_I
%token K_VAR K_VAR_S K_vpi_call K_vpi_func K_disable K_fork
%token K_vpi_module
%token K_vpi_module K_vpi_time_precision
%token <text> T_INSTR
%token <text> T_LABEL
@ -93,6 +93,10 @@ header_lines
header_line
: K_vpi_module T_STRING ';'
{ compile_load_vpi_module($2); }
| K_vpi_time_precision '+' T_NUMBER ';'
{ compile_vpi_time_precision($3); }
| K_vpi_time_precision '-' T_NUMBER ';'
{ compile_vpi_time_precision(-$3); }
;
/* A program is simply a list of statements. No other structure. */
@ -474,6 +478,10 @@ int compile_design(const char*path)
/*
* $Log: parse.y,v $
* Revision 1.33 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.32 2001/06/16 23:45:05 steve
* Add support for structural multiply in t-dll.
* Add code generators and vvp support for both

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vpi_priv.cc,v 1.6 2001/06/21 22:54:12 steve Exp $"
#ident "$Id: vpi_priv.cc,v 1.7 2001/06/30 23:03:17 steve Exp $"
#endif
# include "vpi_priv.h"
@ -44,8 +44,7 @@ static int vpip_get_global(int property)
switch (property) {
case vpiTimePrecision:
fprintf(stderr, "vpi Sorry: vpiTimePrecision not supported\n");
return 0;
return vpip_get_time_precision();
default:
fprintf(stderr, "vpi error: bad global property: %d\n", property);
@ -152,6 +151,10 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap)
/*
* $Log: vpi_priv.cc,v $
* Revision 1.7 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.6 2001/06/21 22:54:12 steve
* Support cbValueChange callbacks.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vpi_priv.h,v 1.17 2001/06/21 22:54:12 steve Exp $"
#ident "$Id: vpi_priv.h,v 1.18 2001/06/30 23:03:17 steve Exp $"
#endif
# include "vpi_user.h"
@ -249,8 +249,15 @@ extern void vpip_execute_vpi_call(vthread_t thr, vpiHandle obj);
vpiHandle vpip_sim_time(void);
extern int vpip_get_time_precision(void);
extern void vpip_set_time_precision(int pres);
/*
* $Log: vpi_priv.h,v $
* Revision 1.18 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.17 2001/06/21 22:54:12 steve
* Support cbValueChange callbacks.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vpi_time.cc,v 1.2 2001/04/03 03:46:14 steve Exp $"
#ident "$Id: vpi_time.cc,v 1.3 2001/06/30 23:03:17 steve Exp $"
#endif
# include "vpi_priv.h"
@ -25,6 +25,9 @@
# include <stdio.h>
# include <assert.h>
static int vpi_time_precision = 0;
static struct __vpiSystemTime {
struct __vpiHandle base;
struct t_vpi_time value;
@ -73,8 +76,23 @@ vpiHandle vpip_sim_time(void)
return &time_handle.base;
}
int vpip_get_time_precision(void)
{
return vpi_time_precision;
}
void vpip_set_time_precision(int pre)
{
vpi_time_precision = pre;
}
/*
* $Log: vpi_time.cc,v $
* Revision 1.3 2001/06/30 23:03:17 steve
* support fast programming by only writing the bits
* that are listed in the input file.
*
* Revision 1.2 2001/04/03 03:46:14 steve
* VPI access time as a decimal string, and
* stub vpi access to the scopes.