Permalink
Browse files

Get the structure for ivl_statement_t worked out.

  • Loading branch information...
steve
steve committed Sep 18, 2000
1 parent 89d7176 commit effc84c46d4f9e6511e833ba566eb2946a1de93d
Showing with 533 additions and 136 deletions.
  1. +2 −2 Makefile.in
  2. +32 −3 ivl_target.h
  3. +87 −0 t-dll-api.cc
  4. +232 −0 t-dll-proc.cc
  5. +11 −129 t-dll.cc
  6. +155 −0 t-dll.h
  7. +14 −2 tgt-stub/stub.c
View
@@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.66 2000/09/17 21:26:15 steve Exp $"
+#ident "$Id: Makefile.in,v 1.67 2000/09/18 01:24:32 steve Exp $"
#
#
SHELL = /bin/sh
@@ -69,7 +69,7 @@ distclean: clean
rm -f config.status config.cache config.log
rm -f Makefile
-TT = t-dll.o t-null.o t-verilog.o t-vvm.o t-xnf.o
+TT = t-dll.o t-dll-api.o t-dll-proc.o t-null.o t-verilog.o t-vvm.o t-xnf.o
FF = nodangle.o synth.o syn-rules.o xnfio.o
O = main.o cprop.o design_dump.o dup_expr.o elaborate.o elab_expr.o \
View
@@ -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.6 2000/08/27 15:51:50 steve Exp $"
+#ident "$Id: ivl_target.h,v 1.7 2000/09/18 01:24:32 steve Exp $"
#endif
#ifdef __cplusplus
@@ -68,6 +68,7 @@ typedef struct ivl_net_signal_s*ivl_net_signal_t;
typedef struct ivl_nexus_s *ivl_nexus_t;
typedef struct ivl_process_s *ivl_process_t;
typedef struct ivl_scope_s *ivl_scope_t;
+typedef struct ivl_statement_s*ivl_statement_t;
/* This function returns the string value of the named flag. The key
@@ -112,6 +113,29 @@ extern const char* ivl_get_nexus_name(ivl_nexus_t net);
extern unsigned ivl_get_signal_pins(ivl_net_signal_t net);
+/*
+ * These functions get information about a process. A process is
+ * an initial or always block within the original Verilog source, that
+ * is translated into a type and a single statement. (The statement
+ * may be a compound statement.)
+ *
+ * The ivl_get_process_type function gets the type of the process,
+ * an "inital" or "always" statement.
+ *
+ * The ivl_get_process_stmt functin gets the statement that forms the
+ * process. See the statement related functions for how to manipulate
+ * statements.
+ */
+typedef enum ivl_process_type {
+ IVL_PR_INITIAL = 0,
+ IVL_PR_ALWAYS = 1
+} ivl_process_type_t;
+
+extern ivl_process_type_t ivl_get_process_type(ivl_process_t net);
+
+extern ivl_statement_t ivl_get_process_stmt(ivl_process_t net);
+
+
/* TARGET MODULE ENTRY POINTS
*
* The module entry points generally take a cookie and possibly a name
@@ -191,8 +215,10 @@ typedef int (*net_signal_f)(const char*name, ivl_net_signal_t net);
block in the design. In principle, the target creates a thread for
each process in the Verilog original.
- XXXX I have not yet decided if it it up to the target to scan the
- process statements, or if I will do that myself. Hmm... */
+ This function is called with the entire thread generated. The
+ process and statement access methods can be used to randomly
+ (read-only) access all the code of the thread. Also, the module may
+ hold on to the process, the core will not delete it. */
typedef int (*process_f)(ivl_process_t net);
@@ -210,6 +236,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
+ * Revision 1.7 2000/09/18 01:24:32 steve
+ * Get the structure for ivl_statement_t worked out.
+ *
* Revision 1.6 2000/08/27 15:51:50 steve
* t-dll iterates signals, and passes them to the
* target module.
View
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2000 Stephen Williams (steve@icarus.com)
+ *
+ * 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
+ * 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.1 2000/09/18 01:24:32 steve Exp $"
+#endif
+
+# include "t-dll.h"
+
+/* THE FOLLOWING ARE FUNCTIONS THAT ARE CALLED FROM THE TARGET. */
+
+extern "C" const char*ivl_get_flag(ivl_design_t des, const char*key)
+{
+ return ((const Design*)des)->get_flag(key).c_str();
+}
+
+extern "C" const char*ivl_get_root_name(ivl_design_t des)
+{
+ return ((const Design*)des)->find_root_scope()->name().c_str();
+}
+
+extern "C" ivl_logic_t ivl_get_logic_type(ivl_net_logic_t net)
+{
+ switch (net->dev_->type()) {
+ case NetLogic::AND:
+ return IVL_AND;
+ case NetLogic::OR:
+ return IVL_OR;
+ }
+ assert(0);
+ return IVL_AND;
+}
+
+extern "C" unsigned ivl_get_logic_pins(ivl_net_logic_t net)
+{
+ return net->dev_->pin_count();
+}
+
+extern "C" ivl_nexus_t ivl_get_logic_pin(ivl_net_logic_t net, unsigned pin)
+{
+ return (ivl_nexus_t) (net->dev_->pin(pin).nexus());
+}
+
+extern "C" const char* ivl_get_nexus_name(ivl_nexus_t net)
+{
+ const Nexus*nex = (const Nexus*)net;
+ return nex->name();
+}
+
+extern "C" ivl_process_type_t ivl_get_process_type(ivl_process_t net)
+{
+ return net->type_;
+}
+
+extern "C" ivl_statement_t ivl_get_process_stmt(ivl_process_t net)
+{
+ return net->stmt_;
+}
+
+extern "C" unsigned ivl_get_signal_pins(ivl_net_signal_t net)
+{
+ const NetNet*sig = (const NetNet*)net;
+ return sig->pin_count();
+}
+
+/*
+ * $Log: t-dll-api.cc,v $
+ * Revision 1.1 2000/09/18 01:24:32 steve
+ * Get the structure for ivl_statement_t worked out.
+ *
+ */
+
Oops, something went wrong.

0 comments on commit effc84c

Please sign in to comment.