-
Notifications
You must be signed in to change notification settings - Fork 24
Fix binmask not being reset when sync_nent goes high #375
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| # The directory where the input files to run are found | ||
| set input_dir "../mem" | ||
|
|
||
| # The directory to save the simulation output to | ||
| set output_dir "./dataOut" | ||
|
|
||
| # The path to the simulation project | ||
| set project_path "../../../../../../proj/vsim_f1/vsim_f1/vsim_f1.xpr" | ||
|
|
||
| # The length of the simulation to run (6us is enough to get through 9 events) | ||
| set sim_time 6us | ||
|
|
||
| # The list of input files to run over | ||
| set mem_files { | ||
| "in_fpga1_0.txt" | ||
| "in_fpga1_1.txt" | ||
| "in_fpga1_2.txt" | ||
| "in_fpga1_3.txt" | ||
| "in_fpga1_4.txt" | ||
| "in_fpga1_5.txt" | ||
| "in_fpga1_6.txt" | ||
| "in_fpga1_7.txt" | ||
| "in_fpga1_8.txt" | ||
| "in_fpga1_9.txt" | ||
| "in_fpga1_10.txt" | ||
| "in_fpga1_11.txt" | ||
| } | ||
|
|
||
| if {[catch {current_project}]} { | ||
| if {![file exists $project_path]} { | ||
| puts "ERROR: Simulation project file not found. Be sure to create a vsim_f1 project." | ||
| exit 1 | ||
| } | ||
|
|
||
| puts "Opening project file $project_path" | ||
| open_project $project_path | ||
| reset_simulation sim_1 | ||
| launch_simulation | ||
| } else { | ||
| puts "Using currently open project." | ||
| } | ||
|
|
||
| set proj_name [get_property NAME [current_project]] | ||
| set proj_dir [get_property DIRECTORY [current_project]] | ||
| set sim_name [get_property NAME [current_fileset -simset]] | ||
| set sim_dir [file join $proj_dir "$proj_name.sim" $sim_name "behav" "xsim"] | ||
| set temp_backup [file join $sim_dir "temp_input.txt"] | ||
|
|
||
| if {[catch {set input_filename [get_value "/top/sourcefile"]} errMsg]} { | ||
| puts "ERROR: Could not infer source input filename." | ||
| exit 1 | ||
| } else { | ||
| set input_filename [string trim $input_filename "\""] | ||
| puts "Using source input filename $input_filename" | ||
| } | ||
|
|
||
| if {[catch {set output_filename [get_value "/top/sinkfile"]} errMsg]} { | ||
| puts "ERROR: Could not infer source output filename." | ||
| exit 1 | ||
| } else { | ||
| set output_filename [string trim $output_filename "\""] | ||
| puts "Using source output filename $output_filename" | ||
| } | ||
|
|
||
| file delete -force $output_dir | ||
| file mkdir $output_dir | ||
|
|
||
| set target_input_path [file join $sim_dir $input_filename] | ||
| set source_output_path [file join $sim_dir $output_filename] | ||
|
|
||
| # Save the existing input file since we will be overwriting it | ||
| puts "Saving copy of original input file $target_input_path" | ||
| file copy -force $target_input_path [file join $sim_dir $temp_backup] | ||
|
|
||
| # try..catch..finally not implemented until tcl 8.6, so we must | ||
| # catch any errors to ensure we restore the existing input file | ||
| set return_status [catch { | ||
| set idx 0 | ||
| foreach mem_file $mem_files { | ||
| set source_input_path [file join $input_dir $mem_file] | ||
| if {![file exists $source_input_path]} { | ||
| puts "WARNING: Input file '$mem_file' does not exist. Skipping..." | ||
| continue | ||
| } | ||
|
|
||
| puts "Copying $source_input_path -> $target_input_path" | ||
| file copy -force $source_input_path $target_input_path | ||
|
|
||
| puts "Running simulation for $mem_file" | ||
| restart | ||
| run $sim_time | ||
| puts "Simulation finished for $mem_file" | ||
|
|
||
| if {[file exists $source_output_path]} { | ||
| set target_output_path [file join $output_dir "out${idx}.txt"] | ||
| file copy -force $source_output_path $target_output_path | ||
| puts "Saved output -> $target_output_path" | ||
| } else { | ||
| puts "WARNING: Output file '$source_output_path' not found after simulation." | ||
| } | ||
|
|
||
| incr idx | ||
| } | ||
| } result options] | ||
|
|
||
| # Restore the existing input file since we overwrote it | ||
| puts "Restoring original input file $target_input_path" | ||
| file copy -force [file join $sim_dir $temp_backup] $target_input_path | ||
| file delete -force [file join $sim_dir $temp_backup] | ||
|
|
||
| # If our code threw an error, we want to report that to the user | ||
| if {$return_status != 0} { | ||
| return -code $return_status -options $options $result | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.