Skip to content

Commit

Permalink
Update faust_sdram_converter.py
Browse files Browse the repository at this point in the history
fix an issue where the replace was happening twice due to the existence of "class mydsp_poly"
  • Loading branch information
DBraun authored Jan 12, 2025
1 parent 2dac497 commit 68aeb98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions architecture/daisy/faust_sdram_converter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
In order to use long delay lines and tables on Daisy devices, it's necessary
to put some buffers in SDRAM. Right now, the Faust backend system doesn't do
this automatically for us, so we do it via Python.
this automatically for us, so we do it via Python. A better approach would
be to use a custom memory manager:
https://faustdoc.grame.fr/manual/architectures/#custom-memory-manager
Before the script, our C++ code might look like this
Expand Down Expand Up @@ -116,7 +118,7 @@ def process_faust_cpp(input_text, debug=True, threshold=1000):

# Add static declarations before class
static_decl_text = '\n'.join(static_declarations) + '\n\n'
input_text = input_text.replace('class mydsp', static_decl_text + 'class mydsp')
input_text = input_text.replace('class mydsp :', static_decl_text + 'class mydsp :')

# Update or add constructor
constructor_match = re.search(r'mydsp\(\)\s*{', modified_content)
Expand Down

0 comments on commit 68aeb98

Please sign in to comment.