From 8a0bcab07323f3a0a104feaec09bce1bc7b1c9b8 Mon Sep 17 00:00:00 2001 From: "ondrej.ille" Date: Mon, 26 Aug 2024 17:06:16 +0200 Subject: [PATCH] src, test: Rename S_PORT to S_SIGNAL since it tracks both nets and ports. --- src/sdf/sdf-dump.c | 10 ++-- src/sdf/sdf-node.c | 12 ++--- src/sdf/sdf-node.h | 14 +++--- src/sdf/sdf-parse.c | 100 ++++++++++++++++++-------------------- test/test_sdf.c | 116 ++++++++++++++++++++++---------------------- 5 files changed, 124 insertions(+), 128 deletions(-) diff --git a/src/sdf/sdf-dump.c b/src/sdf/sdf-dump.c index 67189b65e..e82f6353e 100644 --- a/src/sdf/sdf-dump.c +++ b/src/sdf/sdf-dump.c @@ -49,7 +49,7 @@ void sdf_dump_number(sdf_node_t number) } } -void sdf_dump_port(sdf_node_t port) +void sdf_dump_signal(sdf_node_t port) { sdf_flags_t flags = sdf_flags(port); bool port_edge = !!((flags & S_F_POSEDGE) || (flags & S_F_NEGEDGE)); @@ -155,8 +155,8 @@ void sdf_dump_expr(sdf_node_t expr) { sdf_kind_t kind = sdf_kind(expr); switch (kind) { - case S_PORT: - sdf_dump_port(expr); + case S_SIGNAL: + sdf_dump_signal(expr); break; default: fatal_trace("cannot dump expression kind: %s", sdf_kind_str(kind)); @@ -208,8 +208,8 @@ void sdf_dump_delay(sdf_node_t delay, int indent) break; } - for (int i = 0; i < sdf_ports(delay); i++) - sdf_dump_port(sdf_port(delay, i)); + for (int i = 0; i < sdf_signals(delay); i++) + sdf_dump_signal(sdf_signal(delay, i)); sdf_dump_value_list(delay); print_syntax(")\n"); diff --git a/src/sdf/sdf-node.c b/src/sdf/sdf-node.c index 1a48ae376..f9d77a442 100644 --- a/src/sdf/sdf-node.c +++ b/src/sdf/sdf-node.c @@ -43,7 +43,7 @@ static const imask_t has_map[S_LAST_NODE_KIND] = { // S_COND (I_IDENT | I_VALUE), - // S_PORT + // S_SIGNAL (I_SUBKIND | I_IDENT | I_DIMS | I_FLAGS | I_VALUE), // S_DELVAL @@ -82,7 +82,7 @@ static const imask_t has_map[S_LAST_NODE_KIND] = { static const char *kind_text_map[S_LAST_NODE_KIND] = { "S_DELAY_FILE", "S_HEADER_ITEM", "S_CELL", "S_DELAY", - "S_TIMING_CHECK", "S_LABEL", "S_COND", "S_PORT", + "S_TIMING_CHECK", "S_LABEL", "S_COND", "S_SIGNAL", "S_DELVAL", "S_VALUE", "S_TRIPPLE", "S_NUMBER", "S_TIMING_ENV", "S_EXCEPTION", "S_CONSTR_PATH", "S_TIMING_ENV", "S_UNARY", "S_BINARY", "S_COMPLEX" @@ -192,19 +192,19 @@ sdf_node_t sdf_cell(sdf_node_t s, unsigned int n) return sdf_array_nth(item, n); } -void sdf_add_port(sdf_node_t s, sdf_node_t port) +void sdf_add_signal(sdf_node_t s, sdf_node_t port) { sdf_array_add(lookup_item(&sdf_object, s, I_PORTS), port); object_write_barrier(&(s->object), &(port->object)); } -unsigned sdf_ports(sdf_node_t s) +unsigned sdf_signals(sdf_node_t s) { item_t *item = lookup_item(&sdf_object, s, I_PORTS); return obj_array_count(item->obj_array); } -sdf_node_t sdf_port(sdf_node_t s, unsigned int n) +sdf_node_t sdf_signal(sdf_node_t s, unsigned int n) { item_t *item = lookup_item(&sdf_object, s, I_PORTS); return sdf_array_nth(item, n); @@ -470,7 +470,7 @@ sdf_node_t sdf_label(sdf_node_t s, unsigned int n) void sdf_add_dim(sdf_node_t s, sdf_node_t dim) { - assert(sdf_kind(s) == S_PORT); + assert(sdf_kind(s) == S_SIGNAL); sdf_array_add(lookup_item(&sdf_object, s, I_DIMS), dim); object_write_barrier(&(s->object), &(dim->object)); diff --git a/src/sdf/sdf-node.h b/src/sdf/sdf-node.h index bf40593de..2c1287c8c 100644 --- a/src/sdf/sdf-node.h +++ b/src/sdf/sdf-node.h @@ -36,9 +36,9 @@ typedef enum { } sdf_header_item_kind_t; typedef enum { - S_PORT_SCALAR, - S_PORT_BUS -} sdf_port_kind_t; + S_SIGNAL_SCALAR, + S_SIGNAL_BUS +} sdf_signal_kind_t; typedef enum { S_DELAY_KIND_IOPATH, @@ -148,7 +148,7 @@ typedef enum { S_TIMING_CHECK, S_LABEL, S_COND, - S_PORT, + S_SIGNAL, S_DELVAL, S_VALUE, S_TRIPPLE, @@ -200,9 +200,9 @@ void sdf_add_cell(sdf_node_t s, sdf_node_t cell); unsigned sdf_cells(sdf_node_t s); sdf_node_t sdf_cell(sdf_node_t s, unsigned int n); -void sdf_add_port(sdf_node_t s, sdf_node_t port); -unsigned sdf_ports(sdf_node_t s); -sdf_node_t sdf_port(sdf_node_t s, unsigned int n); +void sdf_add_signal(sdf_node_t s, sdf_node_t port); +unsigned sdf_signals(sdf_node_t s); +sdf_node_t sdf_signal(sdf_node_t s, unsigned int n); void sdf_add_value(sdf_node_t s, sdf_node_t literal); unsigned sdf_values(sdf_node_t s); diff --git a/src/sdf/sdf-parse.c b/src/sdf/sdf-parse.c index 9038fcd30..c3291e367 100644 --- a/src/sdf/sdf-parse.c +++ b/src/sdf/sdf-parse.c @@ -405,13 +405,10 @@ static ident_t p_hierarchical_identifier(void) ident_t id = p_identifier(); - // TODO: Should we do a conversion to DOT here or keep the original separator ? - // Pros of conversion: - // - Identifier is normalizedto rest of the code-base and ident_walk can be used - // Consd of conversion: - // - When dumping, we can't just dump the ID, but need to do walk, and replace - // by actual hchar -> This is OK, since dump is used for debug / test! - + // Hierarchical identifier is purposefully converted to '.' separator. + // This-way, "ident_walk_selected" can be used to walk the hierarchy. + // To dump the identifier, dumper walks the ID and replaces '.' by + // actual hierarchy separator to get to the original source! while (scan(tDOT, tOVER)) { int tok = peek(); consume(tok); @@ -565,10 +562,9 @@ static sdf_node_t p_scalar_node(void) BEGIN("scalar node"); - // TODO: Should we make some distiniction between internal "net" or "signal" ?? - // Grammar-wise, it is not possible. One needs to have elaborated design. - sdf_node_t p = sdf_new(S_PORT); - sdf_set_subkind(p, S_PORT_SCALAR); + // There is no difference between Net and Port, both are signal! + sdf_node_t p = sdf_new(S_SIGNAL); + sdf_set_subkind(p, S_SIGNAL_SCALAR); ident_t hier = p_hierarchical_identifier(); sdf_set_ident(p, hier); @@ -610,8 +606,8 @@ static sdf_node_t p_port_instance(void) BEGIN("port instance"); - sdf_node_t p = sdf_new(S_PORT); - sdf_port_kind_t kind = S_PORT_SCALAR; + sdf_node_t p = sdf_new(S_SIGNAL); + sdf_signal_kind_t kind = S_SIGNAL_SCALAR; ident_t hier = p_hierarchical_identifier(); sdf_set_ident(p, hier); @@ -623,7 +619,7 @@ static sdf_node_t p_port_instance(void) if (optional(tCOLON)) { sdf_node_t right = p_integer(); sdf_add_dim(p, right); - kind = S_PORT_BUS; + kind = S_SIGNAL_BUS; } consume(tRSQUARE); @@ -1182,8 +1178,8 @@ static sdf_node_t p_path_constraint(void) if (peek_nth(2) == tNAME) p_name(constr); - sdf_add_port(constr, p_port_instance()); - sdf_add_port(constr, p_port_instance()); + sdf_add_signal(constr, p_port_instance()); + sdf_add_signal(constr, p_port_instance()); // TODO: Add optional follow-up of "port_instance" @@ -1230,7 +1226,7 @@ static sdf_node_t p_period_constraint(void) sdf_node_t constr = sdf_new(S_CONSTRAINT); sdf_set_subkind(constr, S_CONSTR_KIND_PERIOD); - sdf_add_port(constr, p_port_instance()); + sdf_add_signal(constr, p_port_instance()); sdf_add_value(constr, p_value()); if (peek_nth(2) == tEXCEPTION) @@ -1252,8 +1248,8 @@ static sdf_node_t p_constraint_path(void) sdf_node_t cp = sdf_new(S_CONSTR_PATH); - sdf_add_port(cp, p_port_instance()); - sdf_add_port(cp, p_port_instance()); + sdf_add_signal(cp, p_port_instance()); + sdf_add_signal(cp, p_port_instance()); consume(tRPAREN); @@ -1273,8 +1269,8 @@ static sdf_node_t p_sum_constraint(void) sdf_node_t constr = sdf_new(S_CONSTRAINT); sdf_set_subkind(constr, S_CONSTR_KIND_SUM); - sdf_add_port(constr, p_constraint_path()); - sdf_add_port(constr, p_constraint_path()); + sdf_add_signal(constr, p_constraint_path()); + sdf_add_signal(constr, p_constraint_path()); // TODO: Add optional follow-up constraint paths. // To decide if it is rvalue or constraint_path, we need second token lookup! @@ -1301,8 +1297,8 @@ static sdf_node_t p_diff_constraint(void) sdf_node_t constr = sdf_new(S_CONSTRAINT); sdf_set_subkind(constr, S_CONSTR_KIND_DIFF); - sdf_add_port(constr, p_constraint_path()); - sdf_add_port(constr, p_constraint_path()); + sdf_add_signal(constr, p_constraint_path()); + sdf_add_signal(constr, p_constraint_path()); sdf_add_value(constr, p_value()); if (scan(tLPAREN)) @@ -1326,7 +1322,7 @@ static sdf_node_t p_skew_constraint(void) sdf_node_t constr = sdf_new(S_CONSTRAINT); sdf_set_subkind(constr, S_CONSTR_KIND_SKEW); - sdf_add_port(constr, p_port_spec()); + sdf_add_signal(constr, p_port_spec()); sdf_add_value(constr, p_value()); consume(tRPAREN); @@ -1348,8 +1344,8 @@ static sdf_node_t p_arrival_env(void) sdf_set_subkind(tenv, S_TIMING_ENV_KIND_ARRIVAL); if (scan(tLPAREN)) - sdf_add_port(tenv, p_port_edge()); - sdf_add_port(tenv, p_port_instance()); + sdf_add_signal(tenv, p_port_edge()); + sdf_add_signal(tenv, p_port_instance()); for (int i = 0; i < 4; i++) sdf_add_value(tenv, p_rvalue()); @@ -1373,8 +1369,8 @@ static sdf_node_t p_departure_env(void) sdf_set_subkind(tenv, S_TIMING_ENV_KIND_DEPARTURE); if (scan(tLPAREN)) - sdf_add_port(tenv, p_port_edge()); - sdf_add_port(tenv, p_port_instance()); + sdf_add_signal(tenv, p_port_edge()); + sdf_add_signal(tenv, p_port_instance()); for (int i = 0; i < 4; i++) sdf_add_value(tenv, p_rvalue()); @@ -1397,7 +1393,7 @@ static sdf_node_t p_slack_env(void) sdf_node_t tenv = sdf_new(S_TIMING_ENV); sdf_set_subkind(tenv, S_TIMING_ENV_KIND_SLACK); - sdf_add_port(tenv, p_port_instance()); + sdf_add_signal(tenv, p_port_instance()); for (int i = 0; i < 4; i++) sdf_add_value(tenv, p_rvalue()); @@ -1423,7 +1419,7 @@ static sdf_node_t p_waveform_env(void) sdf_node_t tenv = sdf_new(S_TIMING_ENV); sdf_set_subkind(tenv, S_TIMING_ENV_KIND_WAVEFORM); - sdf_add_port(tenv, p_port_instance()); + sdf_add_signal(tenv, p_port_instance()); sdf_add_value(tenv, p_real_number()); p_edge_list(tenv); @@ -1626,8 +1622,8 @@ static sdf_node_t p_nochange_timing_check(void) sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); sdf_set_subkind(tcheck, S_TCHECK_NOCHANGE); - sdf_add_port(tcheck, p_port_tchk()); - sdf_add_port(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); sdf_add_value(tcheck, p_rvalue()); sdf_add_value(tcheck, p_rvalue()); @@ -1648,8 +1644,8 @@ static sdf_node_t p_bidirectskew_timing_check(void) sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); sdf_set_subkind(tcheck, S_TCHECK_BIDIRSKEW); - sdf_add_port(tcheck, p_port_tchk()); - sdf_add_port(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); sdf_add_value(tcheck, p_value()); sdf_add_value(tcheck, p_value()); @@ -1670,8 +1666,8 @@ static sdf_node_t p_skew_timing_check(void) sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); sdf_set_subkind(tcheck, S_TCHECK_SKEW); - sdf_add_port(tcheck, p_port_tchk()); - sdf_add_port(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); + sdf_add_signal(tcheck, p_port_tchk()); sdf_add_value(tcheck, p_rvalue()); consume(tRPAREN); @@ -1695,7 +1691,7 @@ static sdf_node_t p_skew_timing_check(void) \ sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); \ sdf_set_subkind(tcheck, subkind); \ - sdf_add_port(tcheck, p_port_tchk()); \ + sdf_add_signal(tcheck, p_port_tchk()); \ sdf_add_value(tcheck, p_value()); \ \ consume(tRPAREN); \ @@ -1722,8 +1718,8 @@ DEFINE_1P1V_TCHK(p_period_timing_check, "period timing check", tPERIOD, S_TCHECK \ sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); \ sdf_set_subkind(tcheck, subkind); \ - sdf_add_port(tcheck, p_port_tchk()); \ - sdf_add_port(tcheck, p_port_tchk()); \ + sdf_add_signal(tcheck, p_port_tchk()); \ + sdf_add_signal(tcheck, p_port_tchk()); \ sdf_add_value(tcheck, p_rvalue()); \ sdf_add_value(tcheck, p_rvalue()); \ \ @@ -1754,8 +1750,8 @@ DEFINE_2P2RV_TCHK(p_recrem_timing_check, "recrem timing check", tRECREM, \ sdf_node_t tcheck = sdf_new(S_TIMING_CHECK); \ sdf_set_subkind(tcheck, subkind); \ - sdf_add_port(tcheck, p_port_tchk()); \ - sdf_add_port(tcheck, p_port_tchk()); \ + sdf_add_signal(tcheck, p_port_tchk()); \ + sdf_add_signal(tcheck, p_port_tchk()); \ sdf_add_value(tcheck, p_value()); \ \ consume(tRPAREN); \ @@ -1839,8 +1835,8 @@ static void p_pathpulsepercent_deltype(sdf_node_t cell) sdf_set_subkind(delay, S_DELAY_KIND_PATHPULSEP); if (scan(tID)) { - sdf_add_port(delay, p_port_instance()); - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); } sdf_add_value(delay, p_value()); @@ -1866,8 +1862,8 @@ static void p_pathpulse_deltype(sdf_node_t cell) sdf_set_subkind(delay, S_DELAY_KIND_PATHPULSE); if (scan(tID)) { - sdf_add_port(delay, p_port_instance()); - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); } sdf_add_value(delay, p_value()); @@ -1891,8 +1887,8 @@ static void p_iopath_def(sdf_node_t delay) sdf_set_subkind(delay, S_DELAY_KIND_IOPATH); - sdf_add_port(delay, p_port_spec()); - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_spec()); + sdf_add_signal(delay, p_port_instance()); // TODO: Add optional retain_def here ! @@ -1953,7 +1949,7 @@ static void p_port_def(sdf_node_t delay) consume(tPORT); sdf_set_subkind(delay, S_DELAY_KIND_PORT); - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); p_delval_list(delay); @@ -1972,8 +1968,8 @@ static void p_interconnect_def(sdf_node_t delay) sdf_set_subkind(delay, S_DELAY_KIND_INTERCONNECT); - sdf_add_port(delay, p_port_instance()); - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); p_delval_list(delay); @@ -1991,7 +1987,7 @@ static void p_netdelay_def(sdf_node_t delay) consume(tNETDELAY); sdf_set_subkind(delay, S_DELAY_KIND_NETDELAY); - sdf_add_port(delay, p_port_spec()); + sdf_add_signal(delay, p_port_spec()); p_delval_list(delay); @@ -2015,7 +2011,7 @@ static void p_device_def(sdf_node_t delay) sdf_set_subkind(delay, S_DELAY_KIND_DEVICE); if (scan(tID)) - sdf_add_port(delay, p_port_instance()); + sdf_add_signal(delay, p_port_instance()); p_delval_list(delay); diff --git a/test/test_sdf.c b/test/test_sdf.c index dac78331e..17f636a28 100644 --- a/test/test_sdf.c +++ b/test/test_sdf.c @@ -245,7 +245,7 @@ START_TEST(test_sdf8) sdf_node_t d_0 = sdf_delay(c, 0); fail_unless(sdf_kind(d_0) == S_DELAY); fail_unless(sdf_subkind(d_0) == S_DELAY_KIND_IOPATH); - fail_unless(sdf_ports(d_0) == 2); + fail_unless(sdf_signals(d_0) == 2); fail_unless(sdf_values(d_0) == 1); fail_unless((sdf_flags(d_0) & S_F_VALUE_ABSOLUTE) > 0); @@ -256,7 +256,7 @@ START_TEST(test_sdf8) sdf_node_t d_1 = sdf_delay(c, 1); fail_unless(sdf_kind(d_1) == S_DELAY); fail_unless(sdf_subkind(d_1) == S_DELAY_KIND_PORT); - fail_unless(sdf_ports(d_1) == 1); + fail_unless(sdf_signals(d_1) == 1); fail_unless(sdf_values(d_1) == 1); fail_unless((sdf_flags(d_1) & S_F_VALUE_ABSOLUTE) > 0); @@ -267,7 +267,7 @@ START_TEST(test_sdf8) sdf_node_t d_2 = sdf_delay(c, 2); fail_unless(sdf_kind(d_2) == S_DELAY); fail_unless(sdf_subkind(d_2) == S_DELAY_KIND_INTERCONNECT); - fail_unless(sdf_ports(d_2) == 2); + fail_unless(sdf_signals(d_2) == 2); fail_unless(sdf_values(d_2) == 1); fail_unless((sdf_flags(d_2) & S_F_VALUE_ABSOLUTE) > 0); @@ -278,7 +278,7 @@ START_TEST(test_sdf8) sdf_node_t d_3 = sdf_delay(c, 3); fail_unless(sdf_kind(d_3) == S_DELAY); fail_unless(sdf_subkind(d_3) == S_DELAY_KIND_NETDELAY); - fail_unless(sdf_ports(d_3) == 1); + fail_unless(sdf_signals(d_3) == 1); fail_unless(sdf_values(d_3) == 1); fail_unless((sdf_flags(d_3) & S_F_VALUE_INCREMENT) > 0); @@ -289,7 +289,7 @@ START_TEST(test_sdf8) sdf_node_t d_4 = sdf_delay(c, 4); fail_unless(sdf_kind(d_4) == S_DELAY); fail_unless(sdf_subkind(d_4) == S_DELAY_KIND_DEVICE); - fail_unless(sdf_ports(d_4) == 1); + fail_unless(sdf_signals(d_4) == 1); fail_unless(sdf_values(d_4) == 1); fail_unless((sdf_flags(d_4) & S_F_VALUE_INCREMENT) > 0); @@ -300,7 +300,7 @@ START_TEST(test_sdf8) sdf_node_t d_5 = sdf_delay(c, 5); fail_unless(sdf_kind(d_5) == S_DELAY); fail_unless(sdf_subkind(d_5) == S_DELAY_KIND_DEVICE); - fail_unless(sdf_ports(d_5) == 0); + fail_unless(sdf_signals(d_5) == 0); fail_unless(sdf_values(d_5) == 1); fail_unless((sdf_flags(d_5) & S_F_VALUE_INCREMENT) > 0); @@ -323,24 +323,24 @@ START_TEST(test_sdf9) sdf_node_t d_0 = sdf_delay(c, 0); - fail_unless(sdf_ports(d_0) == 2); - sdf_node_t d_0_p_0 = sdf_port(d_0, 0); - sdf_node_t d_0_p_1 = sdf_port(d_0, 1); - fail_unless(sdf_kind(d_0_p_0) == S_PORT); - fail_unless(sdf_kind(d_0_p_1) == S_PORT); - fail_unless(sdf_subkind(d_0_p_0) == S_PORT_SCALAR); - fail_unless(sdf_subkind(d_0_p_1) == S_PORT_SCALAR); + fail_unless(sdf_signals(d_0) == 2); + sdf_node_t d_0_p_0 = sdf_signal(d_0, 0); + sdf_node_t d_0_p_1 = sdf_signal(d_0, 1); + fail_unless(sdf_kind(d_0_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_0_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_0_p_0) == S_SIGNAL_SCALAR); + fail_unless(sdf_subkind(d_0_p_1) == S_SIGNAL_SCALAR); fail_unless(sdf_ident(d_0_p_0) == ident_new("a")); fail_unless(sdf_ident(d_0_p_1) == ident_new("x")); sdf_node_t d_1 = sdf_delay(c, 1); - fail_unless(sdf_ports(d_1) == 2); - sdf_node_t d_1_p_0 = sdf_port(d_1, 0); - sdf_node_t d_1_p_1 = sdf_port(d_1, 1); - fail_unless(sdf_kind(d_1_p_0) == S_PORT); - fail_unless(sdf_kind(d_1_p_1) == S_PORT); - fail_unless(sdf_subkind(d_1_p_0) == S_PORT_SCALAR); - fail_unless(sdf_subkind(d_1_p_1) == S_PORT_SCALAR); + fail_unless(sdf_signals(d_1) == 2); + sdf_node_t d_1_p_0 = sdf_signal(d_1, 0); + sdf_node_t d_1_p_1 = sdf_signal(d_1, 1); + fail_unless(sdf_kind(d_1_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_1_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_1_p_0) == S_SIGNAL_SCALAR); + fail_unless(sdf_subkind(d_1_p_1) == S_SIGNAL_SCALAR); fail_unless(sdf_ident(d_1_p_0) == ident_new("top.dut.b")); fail_unless(sdf_ident(d_1_p_1) == ident_new("top.dut.x")); fail_unless(sdf_dims(d_1_p_0) == 1); @@ -351,13 +351,13 @@ START_TEST(test_sdf9) fail_unless(sdf_ival(d_1_min_p_1) == 921); sdf_node_t d_2 = sdf_delay(c, 2); - fail_unless(sdf_ports(d_2) == 2); - sdf_node_t d_2_p_0 = sdf_port(d_2, 0); - sdf_node_t d_2_p_1 = sdf_port(d_2, 1); - fail_unless(sdf_kind(d_2_p_0) == S_PORT); - fail_unless(sdf_kind(d_2_p_1) == S_PORT); - fail_unless(sdf_subkind(d_2_p_0) == S_PORT_BUS); - fail_unless(sdf_subkind(d_2_p_1) == S_PORT_BUS); + fail_unless(sdf_signals(d_2) == 2); + sdf_node_t d_2_p_0 = sdf_signal(d_2, 0); + sdf_node_t d_2_p_1 = sdf_signal(d_2, 1); + fail_unless(sdf_kind(d_2_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_2_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_2_p_0) == S_SIGNAL_BUS); + fail_unless(sdf_subkind(d_2_p_1) == S_SIGNAL_BUS); fail_unless(sdf_ident(d_2_p_0) == ident_new("b")); fail_unless(sdf_ident(d_2_p_1) == ident_new("x")); fail_unless(sdf_dims(d_2_p_0) == 2); @@ -387,26 +387,26 @@ START_TEST(test_sdf10) fail_unless(sdf_delays(c) == 3); sdf_node_t d_0 = sdf_delay(c, 0); - fail_unless(sdf_ports(d_0) == 2); - sdf_node_t d_0_p_0 = sdf_port(d_0, 0); - sdf_node_t d_0_p_1 = sdf_port(d_0, 1); - fail_unless(sdf_kind(d_0_p_0) == S_PORT); - fail_unless(sdf_kind(d_0_p_1) == S_PORT); - fail_unless(sdf_subkind(d_0_p_0) == S_PORT_SCALAR); - fail_unless(sdf_subkind(d_0_p_1) == S_PORT_SCALAR); + fail_unless(sdf_signals(d_0) == 2); + sdf_node_t d_0_p_0 = sdf_signal(d_0, 0); + sdf_node_t d_0_p_1 = sdf_signal(d_0, 1); + fail_unless(sdf_kind(d_0_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_0_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_0_p_0) == S_SIGNAL_SCALAR); + fail_unless(sdf_subkind(d_0_p_1) == S_SIGNAL_SCALAR); fail_unless(sdf_ident(d_0_p_0) == ident_new("clk_a")); fail_unless(sdf_ident(d_0_p_1) == ident_new("x_q")); fail_unless(sdf_dims(d_0_p_0) == 0); fail_unless(sdf_dims(d_0_p_1) == 0); sdf_node_t d_1 = sdf_delay(c, 1); - fail_unless(sdf_ports(d_1) == 2); - sdf_node_t d_1_p_0 = sdf_port(d_1, 0); - sdf_node_t d_1_p_1 = sdf_port(d_1, 1); - fail_unless(sdf_kind(d_1_p_0) == S_PORT); - fail_unless(sdf_kind(d_1_p_1) == S_PORT); - fail_unless(sdf_subkind(d_1_p_0) == S_PORT_SCALAR); - fail_unless(sdf_subkind(d_1_p_1) == S_PORT_SCALAR); + fail_unless(sdf_signals(d_1) == 2); + sdf_node_t d_1_p_0 = sdf_signal(d_1, 0); + sdf_node_t d_1_p_1 = sdf_signal(d_1, 1); + fail_unless(sdf_kind(d_1_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_1_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_1_p_0) == S_SIGNAL_SCALAR); + fail_unless(sdf_subkind(d_1_p_1) == S_SIGNAL_SCALAR); fail_unless(sdf_ident(d_1_p_0) == ident_new("clk_b")); fail_unless(sdf_ident(d_1_p_1) == ident_new("y_q")); fail_unless(sdf_dims(d_1_p_0) == 1); @@ -415,13 +415,13 @@ START_TEST(test_sdf10) fail_unless(sdf_ival(d_1_min_p_0) == 17); sdf_node_t d_2 = sdf_delay(c, 2); - fail_unless(sdf_ports(d_2) == 2); - sdf_node_t d_2_p_0 = sdf_port(d_2, 0); - sdf_node_t d_2_p_1 = sdf_port(d_2, 1); - fail_unless(sdf_kind(d_2_p_0) == S_PORT); - fail_unless(sdf_kind(d_2_p_1) == S_PORT); - fail_unless(sdf_subkind(d_2_p_0) == S_PORT_BUS); - fail_unless(sdf_subkind(d_2_p_1) == S_PORT_BUS); + fail_unless(sdf_signals(d_2) == 2); + sdf_node_t d_2_p_0 = sdf_signal(d_2, 0); + sdf_node_t d_2_p_1 = sdf_signal(d_2, 1); + fail_unless(sdf_kind(d_2_p_0) == S_SIGNAL); + fail_unless(sdf_kind(d_2_p_1) == S_SIGNAL); + fail_unless(sdf_subkind(d_2_p_0) == S_SIGNAL_BUS); + fail_unless(sdf_subkind(d_2_p_1) == S_SIGNAL_BUS); fail_unless(sdf_ident(d_2_p_0) == ident_new("clk_c")); fail_unless(sdf_ident(d_2_p_1) == ident_new("z_q")); fail_unless(sdf_dims(d_2_p_0) == 2); @@ -647,8 +647,8 @@ START_TEST(test_sdf15) fail_unless(sdf_subkind(d_2) == S_DELAY_KIND_PATHPULSE); fail_unless(sdf_values(d_2) == 1); - sdf_node_t d_2_p_1 = sdf_port(d_2, 0); - sdf_node_t d_2_p_2 = sdf_port(d_2, 1); + sdf_node_t d_2_p_1 = sdf_signal(d_2, 0); + sdf_node_t d_2_p_2 = sdf_signal(d_2, 1); fail_unless(icmp(sdf_ident(d_2_p_1), "my_inst.my_sub_inst.a")); fail_unless(icmp(sdf_ident(d_2_p_2), "my_inst_my_sub_inst.b")); @@ -660,8 +660,8 @@ START_TEST(test_sdf15) fail_unless(sdf_subkind(d_3) == S_DELAY_KIND_PATHPULSEP); fail_unless(sdf_values(d_3) == 2); - sdf_node_t d_3_p_1 = sdf_port(d_3, 0); - sdf_node_t d_3_p_2 = sdf_port(d_3, 1); + sdf_node_t d_3_p_1 = sdf_signal(d_3, 0); + sdf_node_t d_3_p_2 = sdf_signal(d_3, 1); fail_unless(icmp(sdf_ident(d_3_p_1), "top.in")); fail_unless(icmp(sdf_ident(d_3_p_2), "top.out")); @@ -693,8 +693,8 @@ START_TEST(test_sdf16) // Delay 0 sdf_node_t d_0 = sdf_delay(c, 0); fail_unless(sdf_subkind(d_0) == S_DELAY_KIND_IOPATH); - fail_unless(icmp(sdf_ident(sdf_port(d_0, 0)), "i_and.a")); - fail_unless(icmp(sdf_ident(sdf_port(d_0, 1)), "i_and.y")); + fail_unless(icmp(sdf_ident(sdf_signal(d_0, 0)), "i_and.a")); + fail_unless(icmp(sdf_ident(sdf_signal(d_0, 1)), "i_and.y")); sdf_node_t d_0_c_0 = sdf_cond(d_0, 0); sdf_node_t d_0_c_0_e_0 = sdf_expr(d_0_c_0); @@ -704,15 +704,15 @@ START_TEST(test_sdf16) sdf_node_t d_0_c_0_e_0_l = sdf_value(d_0_c_0_e_0, 0); sdf_node_t d_0_c_0_e_0_r = sdf_value(d_0_c_0_e_0, 1); - fail_unless(sdf_kind(d_0_c_0_e_0_l) == S_PORT); + fail_unless(sdf_kind(d_0_c_0_e_0_l) == S_SIGNAL); fail_unless(sdf_kind(d_0_c_0_e_0_r) == S_NUMBER); fail_unless(sdf_ival(d_0_c_0_e_0_r) == 0); // Delay 1 sdf_node_t d_1 = sdf_delay(c, 1); fail_unless(sdf_subkind(d_1) == S_DELAY_KIND_IOPATH); - fail_unless(icmp(sdf_ident(sdf_port(d_1, 0)), "i_and.a")); - fail_unless(icmp(sdf_ident(sdf_port(d_1, 1)), "i_and.y")); + fail_unless(icmp(sdf_ident(sdf_signal(d_1, 0)), "i_and.a")); + fail_unless(icmp(sdf_ident(sdf_signal(d_1, 1)), "i_and.y")); sdf_node_t d_1_c_0 = sdf_cond(d_1, 0); fail_unless(icmp(sdf_ident(d_1_c_0), "\"My condition name\"")); @@ -724,7 +724,7 @@ START_TEST(test_sdf16) sdf_node_t d_1_c_0_e_0_l = sdf_value(d_1_c_0_e_0, 0); sdf_node_t d_1_c_0_e_0_r = sdf_value(d_1_c_0_e_0, 1); - fail_unless(sdf_kind(d_1_c_0_e_0_l) == S_PORT); + fail_unless(sdf_kind(d_1_c_0_e_0_l) == S_SIGNAL); fail_unless(icmp(sdf_ident(d_1_c_0_e_0_l), "i_and.b")); fail_unless(sdf_kind(d_1_c_0_e_0_r) == S_NUMBER); fail_unless(sdf_ival(d_1_c_0_e_0_r) == 1);