Skip to content

Commit e452f4d

Browse files
author
djns1
committed
Implemented InOuts
1 parent 5704dd0 commit e452f4d

18 files changed

+301
-178
lines changed

ODIN_II/SRC/ast_elaborate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,12 +2660,12 @@ void create_param_table_for_scope(ast_node_t* module_items, sc_hierarchy* local_
26602660
/* symbols are already dealt with */
26612661
if (var_declare->types.variable.is_input
26622662
|| var_declare->types.variable.is_output
2663+
|| var_declare->types.variable.is_inout
26632664
|| var_declare->types.variable.is_reg
26642665
|| var_declare->types.variable.is_integer
26652666
|| var_declare->types.variable.is_genvar
26662667
|| var_declare->types.variable.is_wire
26672668
|| var_declare->types.variable.is_defparam)
2668-
26692669
continue;
26702670

26712671
oassert(module_items->children[i]->children[j]->type == VAR_DECLARE);

ODIN_II/SRC/netlist_create_from_ast.cpp

Lines changed: 98 additions & 90 deletions
Large diffs are not rendered by default.

ODIN_II/SRC/parse_making_ast.cpp

Lines changed: 82 additions & 50 deletions
Large diffs are not rendered by default.

ODIN_II/SRC/read_blif.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ static void build_top_input_node(const char* name_str, Hashtable* output_nets_ha
10161016

10171017
void add_top_input_nodes(FILE* file, Hashtable* output_nets_hash) {
10181018
/**
1019-
* insert a global clock for fall back.
1019+
* insert a global clock for fall back.
10201020
* in case of undriven internal clocks, they will attach to the global clock
10211021
* this also fix the issue of constant verilog (no input)
10221022
* that cannot simulate due to empty input vector

ODIN_II/regression_test/benchmark/task/syntax/task.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ arch_list_add=k6_frac_N10_frac_chain_mem32K_40nm.xml
1616
circuits_dir=regression_test/benchmark/verilog/
1717

1818
circuit_list_add=syntax/*.v
19+
circuit_list_add=syntax/inout-syntax/*.v
1920

2021
synthesis_parse_file=regression_test/parse_result/conf/synth.toml
2122
simulation_parse_file=regression_test/parse_result/conf/sim.toml
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module simple_op(in_out1,in_out2,en);
2+
inout in_out1;
3+
inout in_out2;
4+
input en;
5+
6+
assign in_out1 = (en) ? in_out2 : 1'bz;
7+
assign in_out2 = (!en) ? in_out1 : 1'bz;
8+
endmodule
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
GLOBAL_SIM_BASE_CLK en in_out1 in_out2
2+
0 1 z z
3+
1 0 z z
4+
0 1 z 0
5+
1 1 z 1
6+
0 0 1 z
7+
1 0 0 z
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
in_out1 in_out2
2+
0 0
3+
1 1
4+
0 0
5+
0 x
6+
1 1
7+
x 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module inout_basic(input dir, inout io, output out);
2+
assign io = (dir) ? dir : 1'bz;
3+
assign out = (!dir) ? io : 1'bx;
4+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
GLOBAL_SIM_BASE_CLK dir io
2+
0 1 0
3+
0 1 0
4+
0 1 1
5+
0 1 1
6+
0 0 0
7+
0 0 0
8+
0 0 1
9+
0 0 1

0 commit comments

Comments
 (0)