cornell-brg / pymtl

Python-based hardware modeling framework
BSD 3-Clause "New" or "Revised" License
237 stars 82 forks source link

Catch invalid params for @s.tick/@s.posedge_clk/@s.combinational blocks #53

Open dmlockhart opened 10 years ago

dmlockhart commented 10 years ago

Conccurrent blocks should be decorated functions which take no params:

  # Valid
  @s.tick
  def logic():

  # Invalid
  @s.tick
  def logic2( some_param )

We previously caught invalid concurrent blocks at runtime, however we should be able to catch this at elaboration time:

        raise Exception("Concurrent block '{}' must take no parameters!\n"
                        "file: {}\n"
                        "line: {}\n"
                        "".format( func.func_name,
                                   func.func_code.co_filename,
                                   func.func_code.co_firstlineno ) )