From: Saif A. <sye...@gm...> - 2012-01-16 18:24:23
|
hello Guenter, as part of the VHDL-to-SC conversion, I was looking at the GCD-2 code. there is a description of a mux as follows: entity mux is port( rst, sLine: in std_logic; load, result: in std_logic_vector( 3 downto 0 ); output: out std_logic_vector( 3 downto 0 ) ); end mux; architecture mux_arc of mux is begin process( rst, sLine, load, result ) begin if( rst = '1' ) then output <= "0000"; -- do nothing elsif sLine = '0' then output <= load; -- load inputs else output <= result; -- load results end if; end process; end mux_arc; there are few doubts that need clarifications: 1. in this mux description, the last assignment operation (output <= result;) is the 'else' clause of the second if-statement (if sLine = '0'). Correct? 2. in the IG graph, the second if-statement (if sLine = '0') and the last assignment operation (output <= result;) both are coming within the first 'else' statement. logically, this renders the code as: IF ( rst = '1' ) then output <= "0000"; ELSE IF sLine = '0' then output <= load; ELSE nothing; END-IF output <= result; //this line will always be executed within this 'else' END-IF I am copying below the DOT code starting from the first if-statement (rst = '1'). Please clarify if I am mis-interpreting something in this context. thanks, Saif o4763369[shape=none,margin=0,label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR><TD COLSPAN="2">org.zamia.instgraph.IGSequentialIf</TD></TR> <TR><TD>fThenSOS</TD><TD PORT="p0">obj</TD></TR> <TR><TD>fElseSOS</TD><TD PORT="p1">obj</TD></TR> <============== the Else-SOS resolves to 2 statements <TR><TD>fCond</TD><TD PORT="p2">obj</TD></TR> <TR><TD>fId</TD><TD PORT="p3">null</TD></TR> </TABLE>>]; o4763369:p0 -> o22716491; o4763369:p1 -> o13745259; o4763369:p2 -> o29275392; o13745259[shape=none,margin=0,label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR><TD COLSPAN="2">org.zamia.instgraph.IGSequenceOfStatements</TD></TR> <TR><TD>fStmts</TD><TD PORT="p0">obj</TD></TR> <TR><TD>fId</TD><TD PORT="p1">null</TD></TR> </TABLE>>]; o13745259:p0 -> o391089378; o391089378[shape=none,margin=0,label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR><TD COLSPAN="2">java.util.ArrayList</TD></TR> <TR><TD>size</TD><TD PORT="p0">2</TD></TR> </TABLE>>]; o391089378:p0 -> o12115416; o391089378:p0 -> o15510521; o12115416[shape=none,margin=0,label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR><TD COLSPAN="2">org.zamia.instgraph.IGSequentialIf</TD></TR> <TR><TD>fThenSOS</TD><TD PORT="p0">obj</TD></TR> <TR><TD>fElseSOS</TD><TD PORT="p1">null</TD></TR> <================= there is no statement in the 'else' <TR><TD>fCond</TD><TD PORT="p2">obj</TD></TR> <TR><TD>fId</TD><TD PORT="p3">null</TD></TR> </TABLE>>]; o12115416:p0 -> o27869524; o12115416:p2 -> o25931923; o15510521[shape=none,margin=0,label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR><TD COLSPAN="2">org.zamia.instgraph.IGSequentialAssignment</TD></TR> <TR><TD>fValue</TD><TD PORT="p0">obj</TD></TR> <TR><TD>fTarget</TD><TD PORT="p1">obj</TD></TR> <TR><TD>fId</TD><TD PORT="p2">null</TD></TR> </TABLE>>]; o15510521:p0 -> o948824; o15510521:p1 -> o8542380; |