Skip to content

Commit 671a0ec

Browse files
author
djns1
committed
Added 'manual' implementation of inout to test behaviour
1 parent 8d0f149 commit 671a0ec

File tree

8 files changed

+72
-12
lines changed

8 files changed

+72
-12
lines changed

ODIN_II/SRC/parse_making_ast.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,9 +1928,10 @@ void graphVizOutputAst_traverse_node(FILE* fp, ast_node_t* node, ast_node_t* fro
19281928
switch (node->type) {
19291929
case VAR_DECLARE: {
19301930
std::stringstream temp;
1931-
if (node->types.variable.is_input) temp << " INPUT";
1932-
if (node->types.variable.is_output) temp << " OUTPUT";
19331931
if (node->types.variable.is_inout) temp << " INOUT";
1932+
else if (node->types.variable.is_input) temp << " INPUT";
1933+
else if (node->types.variable.is_output) temp << " OUTPUT";
1934+
19341935
if (node->types.variable.is_port) temp << " PORT";
19351936
if (node->types.variable.is_parameter) temp << " PARAMETER";
19361937
if (node->types.variable.is_wire) temp << " WIRE";

ODIN_II/exec_wrapper.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,13 @@ function display() {
175175
esac
176176

177177
# check for uncaught errors
178-
179178
ERROR_CATCH="$(cat "${LOG_FILE}" | grep 'Odin exited with code: ' | awk '{print $5}' | grep -E '^\-?[0-9]+$')"
180179
[ "_${ERROR_CATCH}" != "_" ] && EXIT_CODE="${ERROR_CATCH}"
181180

182181
EXIT_ERROR_TYPE=$( print_exit_type "${EXIT_CODE}" )
183182

183+
MISMATCH_CHECK="$(cat "${LOG_FILE}" | grep "Error::OUTPUT_BLIF Vector files differ.")"
184+
[ "_${MISMATCH_CHECK}" != "_" ] && EXIT_ERROR_TYPE="MISMATCH"
184185

185186
if [ "_${EXIT_CODE}" == "_0" ] && [ "_${LEAK_MESSAGE}" == "_" ]
186187
then
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
module inout_reg(input oe, inout line);
2-
reg val;
3-
assign line = oe ? val : 1'bz;
4-
assign val = oe ? 1'bz : line;
1+
module selector(input sel, input in, output out, inout io);
2+
// Select if selector is set
3+
assign io = (sel) ? in : 1'bz;
4+
assign out = io;
55
endmodule
66

7-
module inout_basic(input oe, input in, output out);
8-
wire internal;
9-
assign internal = oe ? 1'bz : in;
10-
inout_reg c(oe, internal);
11-
assign out = internal;
7+
module inout_basic(input line_sel, input in1, input in2, output out);
8+
tri internal;
9+
tri wip;
10+
wire not_sel;
11+
assign not_sel = !line_sel;
12+
// Select in1 if oe
13+
selector s1( line_sel, in1, wip, internal, internal );
14+
// Selects in2 if !oe
15+
selector s2( not_sel, in2, wip, internal, internal );
16+
assign out = wip;
1217
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
GLOBAL_SIM_BASE_CLK line_sel in1 in2
2+
0 1 0 0
3+
0 1 0 1
4+
0 1 1 0
5+
0 1 1 1
6+
0 0 0 0
7+
0 0 0 1
8+
0 0 1 0
9+
0 0 1 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
out
2+
0
3+
0
4+
1
5+
1
6+
0
7+
1
8+
0
9+
1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module selector_manual(input sel, input in, output out, input io_in, output io_out);
2+
// Select if selector is set
3+
assign io_out = (sel) ? in : 1'b1;
4+
assign out = io_in;
5+
endmodule
6+
7+
module inout_manual(input line_sel, input in1, input in2, output out);
8+
tri internal;
9+
tri wip;
10+
wire not_sel;
11+
assign not_sel = !line_sel;
12+
// Select in1 if oe
13+
selector_manual s1( line_sel, in1, wip, internal, internal );
14+
// Selects in2 if !oe
15+
selector_manual s2( not_sel, in2, wip, internal, internal );
16+
assign out = wip;
17+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
GLOBAL_SIM_BASE_CLK line_sel in1 in2
2+
0 1 0 0
3+
0 1 0 1
4+
0 1 1 0
5+
0 1 1 1
6+
0 0 0 0
7+
0 0 0 1
8+
0 0 1 0
9+
0 0 1 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
out
2+
0
3+
0
4+
1
5+
1
6+
0
7+
1
8+
0
9+
1

0 commit comments

Comments
 (0)