- 
                Notifications
    You must be signed in to change notification settings 
- Fork 390
synth: add SYNTH_MOCK_LARGE_MEMORIES #3621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
synth: add SYNTH_MOCK_LARGE_MEMORIES #3621
Conversation
Signed-off-by: Øyvind Harboe <[email protected]>
        
          
                flow/scripts/synth.tcl
              
                Outdated
          
        
      | set size [memory_get $module $mem SIZE] | ||
|  | ||
| if {$size > $::env(SYNTH_MEMORY_MAX_BITS)} { | ||
| memory_set $module $mem SIZE 1 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oharboe Is memory_set a hypothetical command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there are other dreamed up commands. Let me see if this can be implemented using real commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. In ChatGPT's defense it did say that it dreamt up these commands and then it looked for alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I offer this for testing:
memory_collect
foreach path [tee -q -s result.string select -list t:\$mem_v2] {
	set index [string first "/" $path]
	set module [string range $path 0 [expr {$index - 1}]]
	set instance [string range $path [expr {$index + 1}] end]
	set width [rtlil::get_param -uint $module $instance WIDTH]
	set size [rtlil::get_param -uint $module $instance SIZE]
	set nbits [expr $width * $size]
	puts "Memory $path has dimensions $size x $width = $nbits"
	if {$nbits > $::env(SYNTH_MEMORY_MAX_BITS)} {
		rtlil::set_param -uint $module $instance SIZE 1
		puts "Shrunk memory $path from $size rows to 1"
	}
}
Signed-off-by: Øyvind Harboe <[email protected]>
| @povik Mysterious error:  | 
| I've found the message template in Yosys. It warns about a special character but at the same time it prints the string containing the special character without escaping hence the mangled output. 
 I'll take a look to see how to fix the script. | 
| @povik Purely for my planning purposes, how long do you think you'll need to see if there's a fix for this PR? Days, weeks, months? If it is very far out, then I think I should close the issue and re-open when we have what we need. | 
| @oharboe a day or two | 
@povik Is there a reasonable way to implement such a SRAM mocking feature?