Add client data pointer for scope and process scanners.

This commit is contained in:
steve 2001-01-15 00:05:39 +00:00
parent 219df169a3
commit 66716f5101
8 changed files with 67 additions and 35 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.31 2001/01/06 06:31:58 steve Exp $"
#ident "$Id: ivl_target.h,v 1.32 2001/01/15 00:05:39 steve Exp $"
#endif
#ifdef __cplusplus
@ -233,10 +233,12 @@ typedef enum ivl_statement_type_e {
} ivl_statement_type_t;
/* This is the type of the function to apply to a process. */
typedef int (*ivl_process_f)(ivl_process_t net);
typedef int (*ivl_process_f)(ivl_process_t net, void*cd);
/* This is the type of a function to apply to a scope. */
typedef int (ivl_scope_f)(ivl_scope_t net);
/* This is the type of a function to apply to a scope. The ivl_scope_t
parameter is the scope, and the cd parameter is client data that
the user passes to the scanner. */
typedef int (ivl_scope_f)(ivl_scope_t net, void*cd);
/* DESIGN
@ -269,7 +271,8 @@ typedef int (ivl_scope_f)(ivl_scope_t net);
*/
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);
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);
/*
@ -505,7 +508,8 @@ extern ivl_signal_t ivl_nexus_ptr_sig(ivl_nexus_ptr_t net);
* signals generated by the compiler.
*/
extern int ivl_scope_children(ivl_scope_t net, ivl_scope_f func);
extern int ivl_scope_children(ivl_scope_t net,
ivl_scope_f func, void*cd);
extern unsigned ivl_scope_logs(ivl_scope_t net);
extern ivl_net_logic_t ivl_scope_log(ivl_scope_t net, unsigned idx);
extern unsigned ivl_scope_lpms(ivl_scope_t net);
@ -644,6 +648,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.32 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.31 2001/01/06 06:31:58 steve
* declaration initialization for time variables.
*

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.19 2000/12/05 06:29:33 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.20 2001/01/15 00:05:39 steve Exp $"
#endif
# include "t-dll.h"
@ -29,10 +29,12 @@ extern "C" const char*ivl_design_flag(ivl_design_t des, const char*key)
return des->self->get_flag(key).c_str();
}
extern "C" int ivl_design_process(ivl_design_t des, ivl_process_f func)
extern "C" int ivl_design_process(ivl_design_t des,
ivl_process_f func,
void*cd)
{
for (ivl_process_t idx = des->threads_; idx; idx = idx->next_) {
int rc = (func)(idx);
int rc = (func)(idx, cd);
if (rc != 0)
return rc;
}
@ -365,10 +367,12 @@ extern "C" ivl_statement_t ivl_process_stmt(ivl_process_t net)
return net->stmt_;
}
extern "C" int ivl_scope_children(ivl_scope_t net, ivl_scope_f func)
extern "C" int ivl_scope_children(ivl_scope_t net,
ivl_scope_f func,
void*cd)
{
for (ivl_scope_t cur = net->child_; cur; cur = cur->sibling_) {
int rc = func(cur);
int rc = func(cur, cd);
if (rc != 0)
return rc;
}
@ -630,6 +634,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.20 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.19 2000/12/05 06:29:33 steve
* Make signal attributes available to ivl_target API.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: fit_reg.c,v 1.2 2000/12/09 05:40:42 steve Exp $"
#ident "$Id: fit_reg.c,v 1.3 2001/01/15 00:05:39 steve Exp $"
#endif
# include <ivl_target.h>
@ -34,14 +34,14 @@
static int scan_ff_q(ivl_lpm_ff_t ff, unsigned q);
int fit_registers(ivl_scope_t scope)
int fit_registers(ivl_scope_t scope, void*x)
{
int rc;
unsigned idx;
unsigned lpms;
/* Scan child scopes first... */
rc = ivl_scope_children(scope, fit_registers);
rc = ivl_scope_children(scope, fit_registers, 0);
if (rc != 0)
return rc;
@ -136,6 +136,9 @@ int scan_ff_q(ivl_lpm_ff_t ff, unsigned q)
/*
* $Log: fit_reg.c,v $
* Revision 1.3 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.2 2000/12/09 05:40:42 steve
* documentation...
*

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: imain.c,v 1.5 2001/01/09 03:10:48 steve Exp $"
#ident "$Id: imain.c,v 1.6 2001/01/15 00:05:39 steve Exp $"
#endif
/*
@ -107,7 +107,7 @@ int target_design(ivl_design_t des)
most constrained step. Everything else must work around the
results of these bindings. */
root = ivl_design_root(des);
get_pad_bindings(root);
get_pad_bindings(root, 0);
if (pal_errors) {
fprintf(stderr, "PAD assignment failed.\n");
@ -122,7 +122,7 @@ int target_design(ivl_design_t des)
/* Scan all the registers, and assign them to
macro-cells. */
root = ivl_design_root(des);
fit_registers(root);
fit_registers(root, 0);
if (pal_errors) {
fprintf(stderr, "Register fitting failed.\n");
pal_free(pal);
@ -150,6 +150,9 @@ DECLARE_CYGWIN_DLL(DllMain);
/*
* $Log: imain.c,v $
* Revision 1.6 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.5 2001/01/09 03:10:48 steve
* Generate the jedec to configure the macrocells.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: pads.c,v 1.1 2000/12/09 01:17:38 steve Exp $"
#ident "$Id: pads.c,v 1.2 2001/01/15 00:05:39 steve Exp $"
#endif
# include "priv.h"
@ -30,11 +30,11 @@
* are fixed by a PAD attribute. Search the scopes recursively,
* looking for signals that may have PAD attributes.
*/
int get_pad_bindings(ivl_scope_t net)
int get_pad_bindings(ivl_scope_t net, void*x)
{
unsigned idx;
int rc = ivl_scope_children(net, get_pad_bindings);
int rc = ivl_scope_children(net, get_pad_bindings, 0);
if (rc)
return rc;
@ -79,6 +79,9 @@ int get_pad_bindings(ivl_scope_t net)
/*
* $Log: pads.c,v $
* Revision 1.2 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.1 2000/12/09 01:17:38 steve
* Add the pal loadable target.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: priv.h,v 1.4 2001/01/09 03:10:48 steve Exp $"
#ident "$Id: priv.h,v 1.5 2001/01/15 00:05:39 steve Exp $"
#endif
# include <ivl_target.h>
@ -90,11 +90,11 @@ extern struct pal_bind_s* bind_pin;
/*
* These are various stepps in the fitting process.
*/
extern int get_pad_bindings(ivl_scope_t net);
extern int get_pad_bindings(ivl_scope_t net, void*x);
extern void absorb_pad_enables(void);
extern int fit_registers(ivl_scope_t scope);
extern int fit_registers(ivl_scope_t scope, void*x);
extern int fit_logic(void);
@ -102,6 +102,9 @@ extern int emit_jedec(const char*path);
/*
* $Log: priv.h,v $
* Revision 1.5 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.4 2001/01/09 03:10:48 steve
* Generate the jedec to configure the macrocells.
*

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: stub.c,v 1.26 2000/12/05 06:29:33 steve Exp $"
#ident "$Id: stub.c,v 1.27 2001/01/15 00:05:39 steve Exp $"
#endif
/*
@ -213,7 +213,7 @@ static void show_statement(ivl_statement_t net, unsigned ind)
}
}
static int show_process(ivl_process_t net)
static int show_process(ivl_process_t net, void*x)
{
switch (ivl_process_type(net)) {
case IVL_PR_INITIAL:
@ -342,7 +342,7 @@ static void show_logic(ivl_net_logic_t net)
fprintf(out, ");\n");
}
static int show_scope(ivl_scope_t net)
static int show_scope(ivl_scope_t net, void*x)
{
unsigned idx;
@ -359,7 +359,7 @@ static int show_scope(ivl_scope_t net)
show_lpm(ivl_scope_lpm(net, idx));
fprintf(out, "end scope %s\n", ivl_scope_name(net));
return ivl_scope_children(net, show_scope);
return ivl_scope_children(net, show_scope, 0);
}
int target_design(ivl_design_t des)
@ -378,8 +378,8 @@ int target_design(ivl_design_t des)
fprintf(out, "root module = %s;\n",
ivl_scope_name(ivl_design_root(des)));
show_scope(ivl_design_root(des));
ivl_design_process(des, show_process);
show_scope(ivl_design_root(des), 0);
ivl_design_process(des, show_process, 0);
fclose(out);
return 0;
@ -392,6 +392,9 @@ DECLARE_CYGWIN_DLL(DllMain);
/*
* $Log: stub.c,v $
* Revision 1.27 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.26 2000/12/05 06:29:33 steve
* Make signal attributes available to ivl_target API.
*

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: verilog.c,v 1.18 2000/11/09 05:14:07 steve Exp $"
#ident "$Id: verilog.c,v 1.19 2001/01/15 00:05:39 steve Exp $"
#endif
/*
@ -142,7 +142,7 @@ static int draw_logic(ivl_net_logic_t net)
* Scan the scope and its children for logic gates. Ise the draw_logic
* function to draw the actual gate.
*/
static int draw_scope_logic(ivl_scope_t scope)
static int draw_scope_logic(ivl_scope_t scope, void*x)
{
unsigned cnt = ivl_scope_logs(scope);
unsigned idx;
@ -151,7 +151,7 @@ static int draw_scope_logic(ivl_scope_t scope)
draw_logic(ivl_scope_log(scope, idx));
}
ivl_scope_children(scope, draw_scope_logic);
ivl_scope_children(scope, draw_scope_logic, 0);
return 0;
}
@ -386,7 +386,7 @@ static void show_statement(ivl_statement_t net, unsigned ind)
* scope. This way, I don't need to do anything about scope
* references.
*/
static int show_process(ivl_process_t net)
static int show_process(ivl_process_t net, void*x)
{
switch (ivl_process_type(net)) {
case IVL_PR_INITIAL:
@ -421,10 +421,10 @@ int target_design(ivl_design_t des)
draw_scoped_objects(des);
/* Declare logic gates. */
draw_scope_logic(ivl_design_root(des));
draw_scope_logic(ivl_design_root(des), 0);
/* Write out processes. */
ivl_design_process(des, show_process);
ivl_design_process(des, show_process, 0);
fprintf(out, "endmodule\n");
fclose(out);
@ -440,6 +440,9 @@ DECLARE_CYGWIN_DLL(DllMain);
/*
* $Log: verilog.c,v $
* Revision 1.19 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
* Revision 1.18 2000/11/09 05:14:07 steve
* show concatenation operators.
*