Skip to content
Snippets Groups Projects

Implement Tmin

Closed Samuel Fagerlund requested to merge tmin into master
3 unresolved threads

Closes #93 (closed)

Merge request reports

Requires 1 approval from eligible users and Protect master.
Code Quality is loading

Closed by Oscar GustafssonOscar Gustafsson 8 months ago (Jul 1, 2024 10:21am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1688 1688
1689 1689 return Schedule(self, algorithm="ASAP").schedule_time
1690 1690
1691 def dfs(self, graph, start, end):
  • One may consider if this should be a "private" method (starting with _) and if it possibly should not be a class method, but a function. One can, e.g., define functions inside methods.

    Or do one expect that this will be used for something else? I can imagine that it can be of interest to actually return the loops, but not sure I understand exactly what this does.

  • Please register or sign in to reply
  • 1761 ]
    1762 if cycles == []:
    1763 return -1
    1764 op_and_latency = {}
    1765 for op in self.operations:
    1766 for lista in cycles:
    1767 for element in lista:
    1768 if op.type_name() not in op_and_latency:
    1769 op_and_latency[op.type_name()] = op.latency
    1770 t_l_values = []
    1771 for loop in cycles:
    1772 loop.pop()
    1773 time_of_loop = 0
    1774 number_of_t_in_loop = 0
    1775 for element in loop:
    1776 if ''.join([i for i in element if not i.isdigit()]) == 't':
    • Suggested change
      1776 if ''.join([i for i in element if not i.isdigit()]) == 't':
      1776 if element.startswtith('t'):

      ? (or maybe this should exactly match t, right?)

      One may consider using a regular expression, but not sure if that is actually better performancewise. '^t[0-9]+' is probably the correct expression to check.

    • Please register or sign in to reply
  • 1766 for lista in cycles:
    1767 for element in lista:
    1768 if op.type_name() not in op_and_latency:
    1769 op_and_latency[op.type_name()] = op.latency
    1770 t_l_values = []
    1771 for loop in cycles:
    1772 loop.pop()
    1773 time_of_loop = 0
    1774 number_of_t_in_loop = 0
    1775 for element in loop:
    1776 if ''.join([i for i in element if not i.isdigit()]) == 't':
    1777 number_of_t_in_loop += 1
    1778 for key, item in op_and_latency.items():
    1779 if key in element:
    1780 time_of_loop += item
    1781 if number_of_t_in_loop == 0 or number_of_t_in_loop == 1:
  • What happens if some operation do not have latency set?

    In general this looks good, but it would be good to add some tests.

    In test_sfg.m you can add something like:

    class TestIterationPeriodBound:
        def test_single_accumulator(self, sfg_simple_accumulator):
            assert sfg_simple_accumulator.iteration_period_bound() == 2

    sfg_simple_accumulator is what is called a fixture, an SFG which is defined in test/fixtures/signal_flow_graph.py. Have a look there and see if there are other SFGs that can be suitable. (Not sure if this one has latency set.)

  • Samuel Fagerlund mentioned in merge request !451 (merged)

    mentioned in merge request !451 (merged)

  • Please register or sign in to reply
    Loading