Skip to content

Commit 2c1a51e

Browse files
authored
Merge pull request verilog-to-routing#876 from CAS-Atlantic/odin_remove_exo_code
Odin_II: remove deprecated or unmaintained code
2 parents d0d9399 + c0bdf4a commit 2c1a51e

File tree

16 files changed

+86
-2258
lines changed

16 files changed

+86
-2258
lines changed

ODIN_II/SRC/adders.cpp

Lines changed: 13 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ OTHER DEALINGS IN THE SOFTWARE.
3030
#include "odin_types.h"
3131
#include "odin_util.h"
3232
#include "node_creation_library.h"
33-
#include "soft_logic_def_parser.h"
3433
#include "adders.h"
3534
#include "netlist_utils.h"
3635
#include "partial_map.h"
@@ -1355,20 +1354,10 @@ int match_pins(nnode_t *node, nnode_t *next_node)
13551354
return flag;
13561355
}
13571356

1358-
1359-
/*---------------------------------------------------------------------------------------------
1360-
* ###########################################################
1361-
* These are function for the soft_logic adders only
1362-
*-------------------------------------------------------------------------------------------*/
1363-
void connect_output_pin_to_node(int *width, int current_pin, int output_pin_id, nnode_t *node, nnode_t *current_adder, short subtraction);
1364-
nnode_t *make_mux_2to1(nnode_t *select, nnode_t *port_a, nnode_t *port_b, nnode_t *node, short mark);
1365-
nnode_t *make_adder(operation_list funct, nnode_t *current_adder, nnode_t *previous_carry, int *width, int current_pin, netlist_t *netlist, nnode_t *node, short subtraction, short mark);
1366-
nnode_t *make_bec(operation_list funct, nnode_t *current_adder, nnode_t *previous_carry, int *width, int current_pin, netlist_t *netlist, nnode_t *node, short subtraction, short mark);
1367-
13681357
/*---------------------------------------------------------------------------------------------
13691358
* connect adder type output pin to a node
13701359
*-------------------------------------------------------------------------------------------*/
1371-
void connect_output_pin_to_node(int *width, int current_pin, int output_pin_id, nnode_t *node, nnode_t *current_adder, short subtraction)
1360+
static void connect_output_pin_to_node(int *width, int current_pin, int output_pin_id, nnode_t *node, nnode_t *current_adder, short subtraction)
13721361
{
13731362
// output
13741363
if(subtraction)
@@ -1390,75 +1379,10 @@ void connect_output_pin_to_node(int *width, int current_pin, int output_pin_id,
13901379
}
13911380
}
13921381

1393-
/*---------------------------------------------------------------------------------------------
1394-
* makes a 2 to 1 mux (select == 1)? port_a : port_b
1395-
*-------------------------------------------------------------------------------------------*/
1396-
nnode_t *make_mux_2to1(nnode_t *select, nnode_t *port_a, nnode_t *port_b, nnode_t *node, short mark)
1397-
{
1398-
nnode_t *mux_2 = make_2port_gate(MUX_2, 2, 2, 1, node, mark);
1399-
1400-
//driver
1401-
nnode_t *notted_gate = make_not_gate(node,mark);
1402-
connect_nodes(select,0,notted_gate,0);
1403-
1404-
1405-
connect_nodes(select,0,mux_2,0);
1406-
connect_nodes(notted_gate,0,mux_2,1);
1407-
1408-
//connect carry skip to mux
1409-
connect_nodes(port_a,0,mux_2,2);
1410-
connect_nodes(port_b,0,mux_2,3);
1411-
return mux_2;
1412-
}
1413-
1414-
nnode_t *make_bec(operation_list funct, nnode_t *current_adder, nnode_t *previous_carry, int* /* width */, int /* current_pin */, netlist_t *netlist, nnode_t *node, short /* subtraction */, short mark)
1415-
{
1416-
nnode_t *new_funct = NULL;
1417-
if(previous_carry == netlist->vcc_node)
1418-
{
1419-
if(funct == ADDER_FUNC)
1420-
{
1421-
new_funct = make_not_gate(node, mark);
1422-
connect_nodes(current_adder, 0, new_funct, 0);
1423-
}
1424-
else if(funct == CARRY_FUNC)
1425-
{
1426-
new_funct = current_adder;
1427-
}
1428-
}
1429-
else if(previous_carry == netlist->gnd_node)
1430-
{
1431-
if(funct == ADDER_FUNC)
1432-
{
1433-
new_funct = current_adder;
1434-
}
1435-
else if(funct == CARRY_FUNC)
1436-
{
1437-
new_funct = netlist->gnd_node;
1438-
}
1439-
}
1440-
else
1441-
{
1442-
if(funct == ADDER_FUNC)
1443-
{
1444-
new_funct = make_2port_gate(LOGICAL_XOR, 1, 1, 1, node, mark);
1445-
connect_nodes(previous_carry,0, new_funct, 0);
1446-
connect_nodes(current_adder,0, new_funct, 1);
1447-
}
1448-
else if(funct == CARRY_FUNC)
1449-
{
1450-
new_funct = make_2port_gate(LOGICAL_AND, 1, 1, 1, node, mark);
1451-
connect_nodes(previous_carry,0, new_funct, 0);
1452-
connect_nodes(current_adder,0, new_funct, 1);
1453-
}
1454-
}
1455-
return new_funct;
1456-
}
1457-
14581382
/*---------------------------------------------------------------------------------------------
14591383
* make a single half-adder (can do unary subtraction, binary subtraction and addition)
14601384
*-------------------------------------------------------------------------------------------*/
1461-
nnode_t *make_adder(operation_list funct, nnode_t *current_adder, nnode_t *previous_carry, int *width, int current_pin, netlist_t *netlist, nnode_t *node, short subtraction, short mark)
1385+
static nnode_t *make_adder(operation_list funct, nnode_t *current_adder, nnode_t *previous_carry, int *width, int current_pin, netlist_t *netlist, nnode_t *node, short subtraction, short mark)
14621386
{
14631387
//make a 2 bit 0r 3 bit sum or carry based on previous carry
14641388
nnode_t *new_funct = NULL;
@@ -1481,10 +1405,7 @@ nnode_t *make_adder(operation_list funct, nnode_t *current_adder, nnode_t *previ
14811405
}
14821406
else
14831407
{
1484-
if(funct == ADDER_FUNC)
1485-
new_funct = make_3port_gate(ADDER_FUNC, 1, 1, 1, 1, node, mark);
1486-
else if(funct == CARRY_FUNC)
1487-
new_funct = make_3port_gate(CARRY_FUNC, 1, 1, 1, 1, node, mark);
1408+
new_funct = make_3port_gate(funct, 1, 1, 1, 1, node, mark);
14881409
connect_nodes(previous_carry, 0, new_funct, 0);
14891410
is_three_port_gate = 1;
14901411
}
@@ -1562,126 +1483,20 @@ nnode_t *make_adder(operation_list funct, nnode_t *current_adder, nnode_t *previ
15621483
return new_funct;
15631484
}
15641485

1565-
/***---------------------------------------------------------------------------------------------
1566-
*
1567-
* bit # : | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
1568-
* blk_type: R->[heterogenous ]
1569-
* [blk size and blk type ]
1570-
*
1571-
* the first bit is built from an/xor gate, everything between could be anything
1572-
* create a single adder block using adder_type_definition file input to select blk size and type
1573-
*-------------------------------------------------------------------------------------------*/
15741486
void instantiate_add_w_carry_block(int *width, nnode_t *node, short mark, netlist_t *netlist, short subtraction)
15751487
{
1576-
//set the default
1577-
int blk_size = width[0];
1578-
nnode_t *initial_carry = (subtraction)? netlist->vcc_node: netlist->gnd_node;
1579-
for(int start_pin=0, current_counter=1 ; start_pin<width[0]; start_pin+=blk_size, current_counter++)
1580-
{
1581-
std::string my_type = "soft";
1582-
std::string sub_structure = "default";
1583-
blk_size = width[0]-start_pin;
1584-
1585-
soft_sub_structure *def = fetch_blk("+",width[0]-start_pin);
1586-
if(def)
1587-
{
1588-
blk_size = (def->bitsize > blk_size)? blk_size: def->bitsize;
1589-
1590-
//don't optimize small circuit
1591-
if(blk_size != 1)
1592-
{
1593-
my_type = def->type;
1594-
sub_structure = def->name;
1595-
}
1596-
1597-
/* pretty print info */
1598-
if(current_counter == 1)
1599-
printf("\n::%s\n[target-bit_size:<%d>START]~", node->name, width[0]-start_pin);
1600-
1601-
printf("~[<%s><%s>::%d]~",my_type.c_str(), sub_structure.c_str(), blk_size);
1602-
1603-
if(blk_size+start_pin == width[0]){
1604-
printf("~[END::sub_module_count:<%d>] \n", current_counter);
1605-
fflush(stdout);
1606-
}
1607-
}
1608-
1609-
nnode_t *previous_carry = initial_carry;
1610-
nnode_t *previous_carry_gnd = netlist->gnd_node;
1611-
nnode_t *previous_carry_vcc = netlist->vcc_node;
1612-
1613-
for(int i = start_pin; i < start_pin+blk_size; i++)
1614-
{
1615-
/* set of flags for building purposes */
1616-
short construct_last_carry_flag = (i != width[0]-1 || !subtraction)? 1:0;
1617-
short last_pin_on_blk_flag = (i == start_pin+blk_size-1)? 1:0;
1618-
1619-
if(my_type == "soft")
1620-
{
1621-
// Ripple Carry Adder
1622-
if(sub_structure == "default"){
1623-
//build adder
1624-
nnode_t *current_adder = make_adder(ADDER_FUNC, NULL, previous_carry, width, i, netlist, node, subtraction, mark);
1625-
if(construct_last_carry_flag)
1626-
previous_carry = make_adder(CARRY_FUNC, current_adder, previous_carry, width, i, netlist, node, subtraction, mark);
1627-
1628-
connect_output_pin_to_node(width, i, 0, node, current_adder, subtraction);
1629-
}
1630-
//Carry Select Adder
1631-
else if(sub_structure == "csla")
1632-
{
1633-
nnode_t *current_adder_gnd = make_adder(ADDER_FUNC, NULL, previous_carry_gnd, width, i, netlist, node, subtraction, mark);
1634-
if(construct_last_carry_flag)
1635-
previous_carry_gnd = make_adder(CARRY_FUNC, current_adder_gnd, previous_carry_gnd, width, i, netlist, node, subtraction, mark);
1636-
1637-
nnode_t *current_adder_vcc = make_adder(ADDER_FUNC, current_adder_gnd, previous_carry_vcc, width, i, netlist, node, subtraction, mark);
1638-
if(construct_last_carry_flag)
1639-
previous_carry_vcc = make_adder(CARRY_FUNC, current_adder_gnd, previous_carry_vcc, width, i, netlist, node, subtraction, mark);
1640-
1641-
nnode_t *current_adder = make_mux_2to1(previous_carry, current_adder_vcc, current_adder_gnd, node, mark);
1642-
1643-
if(last_pin_on_blk_flag && construct_last_carry_flag)
1644-
previous_carry = make_mux_2to1(previous_carry, previous_carry_vcc, previous_carry_gnd, node, mark);
1645-
1646-
connect_output_pin_to_node(width, i, 0, node, current_adder, subtraction);
1647-
}
1648-
//binary to excess Carry Select Adder
1649-
else if(sub_structure == "bec_csla")
1650-
{
1651-
nnode_t *current_adder_gnd = make_adder(ADDER_FUNC, NULL, previous_carry_gnd, width, i, netlist, node, subtraction, mark);
1652-
if(construct_last_carry_flag)
1653-
previous_carry_gnd = make_adder(CARRY_FUNC, current_adder_gnd, previous_carry_gnd, width, i, netlist, node, subtraction, mark);
1488+
nnode_t *previous_carry = (subtraction)? netlist->vcc_node: netlist->gnd_node;
16541489

1655-
nnode_t *current_adder_vcc = make_bec(ADDER_FUNC, current_adder_gnd, previous_carry_vcc, width, i, netlist, node, subtraction, mark);
1656-
if(construct_last_carry_flag)
1657-
previous_carry_vcc = make_bec(CARRY_FUNC, current_adder_gnd, previous_carry_vcc, width, i, netlist, node, subtraction, mark);
1658-
1659-
nnode_t *current_adder = make_mux_2to1(previous_carry, current_adder_vcc, current_adder_gnd, node, mark);
1490+
for(int i = 0; i < width[0]; i++)
1491+
{
1492+
/* set of flags for building purposes */
1493+
short construct_last_carry_flag = (i != width[0]-1 || !subtraction)? 1:0;
16601494

1661-
if(last_pin_on_blk_flag && construct_last_carry_flag)
1662-
previous_carry = make_mux_2to1(previous_carry, previous_carry_vcc, previous_carry_gnd, node, mark);
1495+
//build Ripple Carry Adder
1496+
nnode_t *current_adder = make_adder(ADDER_FUNC, NULL, previous_carry, width, i, netlist, node, subtraction, mark);
1497+
if(construct_last_carry_flag)
1498+
previous_carry = make_adder(CARRY_FUNC, current_adder, previous_carry, width, i, netlist, node, subtraction, mark);
16631499

1664-
connect_output_pin_to_node(width, i, 0, node, current_adder, subtraction);
1665-
}
1666-
else
1667-
{
1668-
error_message(NETLIST_ERROR, -1, -1, "( %s )is not a valid substructure name", sub_structure.c_str());
1669-
return;
1670-
}
1671-
}
1672-
else // if(my_type == "hard")
1673-
{
1674-
// carry lookahead
1675-
// if(sub_structure == "cla")
1676-
// {
1677-
// error_message(NETLIST_ERROR, -1, -1, "( %s )is not a valid substructure name", sub_structure.c_str());
1678-
// }
1679-
// else
1680-
// {
1681-
error_message(NETLIST_ERROR, -1, -1, "( %s )is not a valid substructure name", sub_structure.c_str());
1682-
// }
1683-
}
1684-
}
1685-
initial_carry = previous_carry;
1500+
connect_output_pin_to_node(width, i, 0, node, current_adder, subtraction);
16861501
}
16871502
}

ODIN_II/SRC/include/odin_types.h

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ struct global_args_t
9898
argparse::ArgValue<bool> all_warnings;
9999
argparse::ArgValue<bool> show_help;
100100

101-
argparse::ArgValue<std::string> adder_def; //carry skip adder skip size
101+
argparse::ArgValue<std::string> adder_def; //DEPRECATED
102+
102103
// defines if the first cin of an adder/subtractor is connected to a global gnd/vdd
103104
// or generated using a dummy adder with both inputs set to gnd/vdd
104105
argparse::ArgValue<bool> adder_cin_global;
@@ -447,8 +448,6 @@ struct nnode_t
447448
netlist_t* internal_netlist; // this is a point of having a subgraph in a node
448449

449450
std::vector<std::vector<signed char>> memory_data;
450-
std::map<int,std::map<long,std::vector<signed char>>> memory_directory;
451-
std::mutex memory_mtx;
452451
//(int cycle, int num_input_pins, npin_t *inputs, int num_output_pins, npin_t *outputs);
453452
void (*simulate_block_cycle)(int, int, int*, int, int*);
454453

@@ -472,21 +471,6 @@ struct nnode_t
472471
unsigned char generic_output; //describes the output (1 or 0) of generic blocks
473472
};
474473

475-
476-
// Ace_Obj_Info_t; /* Activity info for each node */
477-
struct ace_obj_info_t
478-
{
479-
int value;
480-
int num_ones;
481-
int num_toggles;
482-
double static_prob;
483-
double switch_prob;
484-
double switch_act;
485-
double prob0to1;
486-
double prob1to0;
487-
int depth;
488-
};
489-
490474
struct npin_t
491475
{
492476
long unique_id;

ODIN_II/SRC/include/simulate_blif.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ void simulate_netlist(netlist_t *netlist);
147147
sim_data_t *init_simulation(netlist_t *netlist);
148148
sim_data_t *terminate_simulation(sim_data_t *sim_data);
149149
int single_step(sim_data_t *sim_data, int wave);
150-
//maria
151-
void simulate_steps_in_parallel(sim_data_t *sim_data,int from_wave,int to_wave,double min_coverage);
152-
void simulate_steps_sequential(sim_data_t *sim_data,double min_coverage);
150+
void simulate_steps(sim_data_t *sim_data,double min_coverage);
153151

154152

155153
nnode_t **get_children_of(nnode_t *node, int *count);

ODIN_II/SRC/include/soft_logic_def_parser.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)