@@ -1467,6 +1467,13 @@ void instantiate_soft_single_port_ram(nnode_t *node, short mark, netlist_t *netl
1467
1467
for (i = 0 ; i < num_addr; i++)
1468
1468
{
1469
1469
npin_t *address_pin = decoder->pins [i];
1470
+ /* Check that the input pin is driven */
1471
+ oassert (
1472
+ address_pin->net ->driver_pin != NULL
1473
+ || address_pin->net == verilog_netlist->zero_net
1474
+ || address_pin->net == verilog_netlist->one_net
1475
+ || address_pin->net == verilog_netlist->pad_net
1476
+ );
1470
1477
1471
1478
// An AND gate to enable and disable writing.
1472
1479
nnode_t *and_g = make_1port_logic_gate (LOGICAL_AND, 2 , node, mark);
@@ -1490,6 +1497,13 @@ void instantiate_soft_single_port_ram(nnode_t *node, short mark, netlist_t *netl
1490
1497
for (j = 0 ; j < num_addr; j++)
1491
1498
{
1492
1499
npin_t *address_pin = decoder->pins [j];
1500
+ /* Check that the input pin is driven */
1501
+ oassert (
1502
+ address_pin->net ->driver_pin != NULL
1503
+ || address_pin->net == verilog_netlist->zero_net
1504
+ || address_pin->net == verilog_netlist->one_net
1505
+ || address_pin->net == verilog_netlist->pad_net
1506
+ );
1493
1507
1494
1508
// A multiplexer switches between accepting incoming data and keeping existing data.
1495
1509
nnode_t *mux = make_2port_gate (MUX_2, 2 , 2 , 1 , node, mark);
@@ -1566,6 +1580,19 @@ void instantiate_soft_dual_port_ram(nnode_t *node, short mark, netlist_t *netlis
1566
1580
npin_t *addr1_pin = decoder1->pins [i];
1567
1581
npin_t *addr2_pin = decoder2->pins [i];
1568
1582
1583
+ oassert (
1584
+ addr1_pin->net ->driver_pin != NULL
1585
+ || addr1_pin->net == verilog_netlist->zero_net
1586
+ || addr1_pin->net == verilog_netlist->one_net
1587
+ || addr1_pin->net == verilog_netlist->pad_net
1588
+ );
1589
+ oassert (
1590
+ addr2_pin->net ->driver_pin != NULL
1591
+ || addr2_pin->net == verilog_netlist->zero_net
1592
+ || addr2_pin->net == verilog_netlist->one_net
1593
+ || addr2_pin->net == verilog_netlist->pad_net
1594
+ );
1595
+
1569
1596
// Write enable and gate for address 1.
1570
1597
nnode_t *and1 = make_1port_logic_gate (LOGICAL_AND, 2 , node, mark);
1571
1598
add_input_pin_to_node (and1, addr1_pin, 0 );
@@ -1606,6 +1633,19 @@ void instantiate_soft_dual_port_ram(nnode_t *node, short mark, netlist_t *netlis
1606
1633
npin_t *addr1_pin = decoder1->pins [j];
1607
1634
npin_t *addr2_pin = decoder2->pins [j];
1608
1635
1636
+ oassert (
1637
+ addr1_pin->net ->driver_pin != NULL
1638
+ || addr1_pin->net == verilog_netlist->zero_net
1639
+ || addr1_pin->net == verilog_netlist->one_net
1640
+ || addr1_pin->net == verilog_netlist->pad_net
1641
+ );
1642
+ oassert (
1643
+ addr2_pin->net ->driver_pin != NULL
1644
+ || addr2_pin->net == verilog_netlist->zero_net
1645
+ || addr2_pin->net == verilog_netlist->one_net
1646
+ || addr2_pin->net == verilog_netlist->pad_net
1647
+ );
1648
+
1609
1649
// The data mux selects between the two data lines for this address.
1610
1650
nnode_t *data_mux = make_2port_gate (MUX_2, 2 , 2 , 1 , node, mark);
1611
1651
// Port 2 before 1 to mimic the simulator's behaviour when the addresses are the same.
@@ -1686,6 +1726,15 @@ signal_list_t *create_decoder(nnode_t *node, short mark, signal_list_t *input_li
1686
1726
int i;
1687
1727
for (i = 0 ; i < num_inputs; i++)
1688
1728
{
1729
+ if (input_list->pins [i]->net ->driver_pin == NULL
1730
+ && input_list->pins [i]->net != verilog_netlist->zero_net
1731
+ && input_list->pins [i]->net != verilog_netlist->one_net
1732
+ && input_list->pins [i]->net != verilog_netlist->pad_net )
1733
+ {
1734
+ warning_message (NETLIST_ERROR, -1 , -1 , " Signal %s is not driven. padding with ground\n " , input_list->pins [i]);
1735
+ add_fanout_pin_to_net (verilog_netlist->zero_net , input_list->pins [i]);
1736
+ }
1737
+
1689
1738
nnode_t *not_g = make_not_gate (node, mark);
1690
1739
remap_pin_to_new_node (input_list->pins [i], not_g, 0 );
1691
1740
npin_t *not_output = allocate_npin ();
0 commit comments