diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-12-02 14:18:44 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-12-02 14:18:44 (GMT) |
commit | 53197953ce382a536bfef870efc4c3f1ccf0f180 (patch) | |
tree | 36854ac3110583441582825e01f4ea7dec9ad5fb /src | |
parent | 03ef761afd6a4c597c0e3fa1714cc947581e2a48 (diff) | |
parent | ff8b0fef70c774bf60cbb822ec378dc999085fde (diff) | |
download | uscxml-53197953ce382a536bfef870efc4c3f1ccf0f180.zip uscxml-53197953ce382a536bfef870efc4c3f1ccf0f180.tar.gz uscxml-53197953ce382a536bfef870efc4c3f1ccf0f180.tar.bz2 |
Merge branch 'master' of github.com:tklab-tud/uscxml
Diffstat (limited to 'src')
-rw-r--r-- | src/uscxml/transform/ChartToVHDL.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/uscxml/transform/ChartToVHDL.cpp b/src/uscxml/transform/ChartToVHDL.cpp index 9ef2f75..69ddb67 100644 --- a/src/uscxml/transform/ChartToVHDL.cpp +++ b/src/uscxml/transform/ChartToVHDL.cpp @@ -1102,7 +1102,7 @@ void ChartToVHDL::writeSignalsAndComponents(std::ostream &stream) { stream << "signal int_event_input : std_logic_vector( " << _eventBitSize << " downto 0);" << std::endl; stream << "signal int_event_output : std_logic_vector( " << _eventBitSize << " downto 0);" << std::endl; stream << "signal next_event_re : std_logic;" << std::endl; - stream << "signal next_event_dequeued : std_logic;" << std::endl; + stream << "signal event_dequeued : std_logic;" << std::endl; stream << "signal next_event : std_logic_vector( " << _eventBitSize << " downto 0);" << std::endl; stream << "signal event_consumed : std_logic;" << std::endl; stream << std::endl; @@ -1183,8 +1183,8 @@ void ChartToVHDL::writeSpontaneousHandler(std::ostream &stream) { stream << " if spontaneous_en = '1' then" << std::endl; stream << " spontaneous_en <= optimal_transition_set_combined_sig;" << std::endl; stream << " else" << std::endl; - //if new event is dequeued then 1 else stay 0 - stream << " spontaneous_en <= next_event_dequeued;" << std::endl; + //if new event is dequeued then 1 else stay 0 (but enable it when queue is empty -> spontaneous based state chart) + stream << " spontaneous_en <= event_dequeued or (not event_dequeued and int_event_empty);" << std::endl; stream << " end if;" << std::endl; stream << " end if;" << std::endl; stream << "end process;" << std::endl; @@ -1204,7 +1204,7 @@ void ChartToVHDL::writeInternalEventHandler(std::ostream &stream) { stream << " event_" << escapeMacro((*eventIter)->value) << "_sig <= '0';" << std::endl; } - stream << " next_event_dequeued <= '0';" << std::endl; + stream << " event_dequeued <= '0';" << std::endl; stream << " event_consumed <= '0';" << std::endl; stream << " elsif falling_edge(clk) and stall = '0' then" << std::endl; @@ -1219,7 +1219,7 @@ void ChartToVHDL::writeInternalEventHandler(std::ostream &stream) { } VBranch *tree = (VASSIGN, - VLINE("event_consumed"), + VLINE(" event_consumed"), eventConsumed); tree->print(stream); stream << ";" << std::endl; @@ -1241,14 +1241,14 @@ void ChartToVHDL::writeInternalEventHandler(std::ostream &stream) { stream << "_sig <= '0';" << std::endl; } } - stream << " next_event_dequeued <= '1';" << std::endl; + stream << " event_dequeued <= '1';" << std::endl; } stream << " when others =>" << std::endl; for (std::list<TrieNode *>::iterator eventIter = _eventNames.begin(); eventIter != _eventNames.end(); eventIter++) { stream << " event_" << escapeMacro((*eventIter)->value) << "_sig <= '0';" << std::endl; } - stream << " next_event_dequeued <= '0';" << std::endl; + stream << " event_dequeued <= '0';" << std::endl; stream << " end case;" << std::endl; stream << " elsif int_event_empty = '1' and event_consumed = '1' then" << std::endl; @@ -1256,7 +1256,7 @@ void ChartToVHDL::writeInternalEventHandler(std::ostream &stream) { eventIter != _eventNames.end(); eventIter++) { stream << " event_" << escapeMacro((*eventIter)->value) << "_sig <= '0';" << std::endl; } - stream << " next_event_dequeued <= '0';" << std::endl; + stream << " event_dequeued <= '0';" << std::endl; stream << " end if;" << std::endl; stream << " end if;" << std::endl; stream << "end process;" << std::endl; @@ -1569,8 +1569,16 @@ void ChartToVHDL::writeSystemSignalMapping(std::ostream &stream) { stream << ";" << std::endl; // tmp mapping for events - stream << "stall <= not en or completed_sig or ( int_event_empty and not spontaneous_en ) ; " << std::endl; - stream << std::endl; +// stream << "stall_handler : process (clk, rst) " << std::endl; +// stream << "begin" << std::endl; +// stream << " if rst = '1' then" << std::endl; +// stream << " stall <= '0';" << std::endl; +// stream << " elsif rising_edge(clk) then" << std::endl; + // empty queue as stall source can arise some issues with state charts just based on spontaneous transitions + stream << " stall <= not en or completed_sig ; --or ( int_event_empty and not spontaneous_en); " << std::endl; +// stream << " end if;" << std::endl; +// stream << "end process;" << std::endl; +// stream << std::endl; // interface signals stream << "-- interface signals" << std::endl; |