diff --git a/ivl.def b/ivl.def index 7012c6682..428403114 100644 --- a/ivl.def +++ b/ivl.def @@ -85,6 +85,8 @@ ivl_logic_basename ivl_logic_delay ivl_logic_drive0 ivl_logic_drive1 +ivl_logic_file +ivl_logic_lineno ivl_logic_name ivl_logic_pin ivl_logic_pins diff --git a/ivl_target.h b/ivl_target.h index 920330abd..038a504cb 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -217,6 +217,7 @@ typedef enum ivl_expr_type_e { IVL_EX_EVENT = 17, IVL_EX_MEMORY = 4, IVL_EX_NUMBER = 5, + IVL_EX_REALNUM = 16, IVL_EX_SCOPE = 6, IVL_EX_SELECT = 7, IVL_EX_SFUNC = 8, @@ -225,8 +226,7 @@ typedef enum ivl_expr_type_e { IVL_EX_TERNARY = 11, IVL_EX_UFUNC = 12, IVL_EX_ULONG = 13, - IVL_EX_UNARY = 14, - IVL_EX_REALNUM = 16 + IVL_EX_UNARY = 14 } ivl_expr_type_t; /* This is the type code for an ivl_net_logic_t object. */ @@ -246,12 +246,12 @@ typedef enum ivl_logic_e { IVL_LO_NOTIF0 = 10, IVL_LO_NOTIF1 = 11, IVL_LO_OR = 12, + IVL_LO_PMOS = 17, IVL_LO_PULLDOWN = 13, IVL_LO_PULLUP = 14, IVL_LO_RCMOS = 23, IVL_LO_RNMOS = 15, IVL_LO_RPMOS = 16, - IVL_LO_PMOS = 17, IVL_LO_XNOR = 18, IVL_LO_XOR = 19, @@ -864,6 +864,9 @@ extern unsigned ivl_file_table_size(void); extern int ivl_island_flag_set(ivl_island_t net, unsigned flag, int value); extern int ivl_island_flag_test(ivl_island_t net, unsigned flag); +extern const char* ivl_logic_file(ivl_net_logic_t net); +extern unsigned ivl_logic_lineno(ivl_net_logic_t net); + /* LOGIC * These types and functions support manipulation of logic gates. The * ivl_logic_t enumeration identifies the various kinds of gates that @@ -1024,7 +1027,6 @@ extern const char* ivl_udp_row(ivl_udp_t net, unsigned idx); extern unsigned ivl_udp_rows(ivl_udp_t net); extern const char* ivl_udp_name(ivl_udp_t net); - extern const char* ivl_lpm_file(ivl_lpm_t net); extern unsigned ivl_lpm_lineno(ivl_lpm_t net); diff --git a/t-dll-api.cc b/t-dll-api.cc index 9e2be7228..db4ad1be4 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -693,6 +693,18 @@ extern "C" int ivl_island_flag_test(ivl_island_t net, unsigned flag) return net->flags[flag]; } +extern "C" const char*ivl_logic_file(ivl_net_logic_t net) +{ + assert(net); + return net->file.str(); +} + +extern "C" unsigned ivl_logic_lineno(ivl_net_logic_t net) +{ + assert(net); + return net->lineno; +} + extern "C" const char* ivl_logic_attr(ivl_net_logic_t net, const char*key) { assert(net); diff --git a/t-dll.cc b/t-dll.cc index da4f93e76..2fd0048a0 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -942,6 +942,9 @@ void dll_target::logic(const NetLogic*net) make_logic_delays_(obj, net); + obj->file = net->get_file(); + obj->lineno = net->get_lineno(); + scope_add_logic(scop, obj); } diff --git a/t-dll.h b/t-dll.h index de0995c16..e153414f1 100644 --- a/t-dll.h +++ b/t-dll.h @@ -1,7 +1,7 @@ #ifndef __t_dll_H #define __t_dll_H /* - * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2011 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 @@ -467,6 +467,8 @@ struct ivl_net_logic_s { perm_string name_; ivl_scope_t scope_; + perm_string file; + unsigned lineno; unsigned npins_; ivl_nexus_t*pins_;