File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ Please check the official [HBS user manual](https://github.com/m-kru/hbs/blob/ma
3838### Changed
3939- Improved error messages.
4040- Improved regex for errors and warnings.
41+ - ` vivado-prj ` : Part is set immediately as ` hbs::SetDevice ` is called.
42+ - ` vivado-prj ` : Bitstream file name changed from current project name to ` hbs::Top ` .
43+ This is required for ` write_hw_platform -include_bit ` command to work without any extra actions.
4144
4245### Fixed
4346- Generics handling for xsim.
Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ namespace eval hbs {
193193
194194 hbs::Debug " setting device to '$dev '"
195195 set hbs::Device $dev
196+
197+ switch $hbs::Tool {
198+ " vivado-prj" { hbs::vivado-prj::setDevice $dev }
199+ }
196200 }
197201
198202 # Sets name of the HDL library.
@@ -1946,6 +1950,10 @@ namespace eval hbs::nvc {
19461950# - implementation.
19471951# - bitstream.
19481952namespace eval hbs::vivado-prj {
1953+ proc setDevice {dev} {
1954+ hbs::Eval " set_property part $dev \[ current_project\] "
1955+ }
1956+
19491957 proc setTool {} {
19501958 set prjName [regsub -all :: "$hbs::ThisCorePath \:\: $hbs::ThisTargetName " --]
19511959 set hbs::targetDir [file join $hbs::BuildDir $prjName ]
@@ -2086,9 +2094,8 @@ namespace eval hbs::vivado-prj {
20862094 #
20872095 hbs::evalPrePrjCbs
20882096 if {$hbs::Device == " " } {
2089- hbs::panic " cannot set part, hbs::Device not set"
2097+ hbs::panic " hbs::Device not set"
20902098 }
2091- hbs::Eval " set_property part $hbs::Device \[ current_project\] "
20922099
20932100 if {$hbs::Top == " " } {
20942101 hbs::panic " cannot set top, hbs::Top not set"
@@ -2127,7 +2134,7 @@ namespace eval hbs::vivado-prj {
21272134 #
21282135 hbs::evalPreBitCbs
21292136 hbs::Eval " open_run impl_1"
2130- hbs::Eval " write_bitstream $hbs::ArgsPrefix \[ get_property DIRECTORY \[ current_run\]\] /\[ current_project \] .bit $hbs::ArgsSuffix "
2137+ hbs::Eval " write_bitstream $hbs::ArgsPrefix \[ get_property DIRECTORY \[ current_run\]\] /$hbs::Top .bit $hbs::ArgsSuffix "
21312138 hbs::evalPostBitCbs
21322139 }
21332140}
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- echo " read_vhdl -library lib_a -vhdl2008 $HBS_TESTS_DIR /dry-run/vivado-prj/a.vhd
3+ echo " set_property part xc7z020clg400-1 [current_project]
4+ read_vhdl -library lib_a -vhdl2008 $HBS_TESTS_DIR /dry-run/vivado-prj/a.vhd
45read_vhdl -library lib_b -vhdl2008 $HBS_TESTS_DIR /dry-run/vivado-prj/b.vhd
56read_verilog -library xil_defaultlib -sv $HBS_TESTS_DIR /dry-run/vivado-prj/c.sv
67set_property generic GEN=64 [current_fileset]
7- set_property part xc7z020clg400-1 [current_project]
88set_property top TopEntity [current_fileset]
99launch_runs SynthArgsPrefix synth_1 SynthArgsSuffix
1010wait_on_run synth_1
@@ -17,7 +17,7 @@ if {[get_property PROGRESS [get_runs impl_1]] != \"100%\"} {
1717 error \" impl_1 failed\"
1818}
1919open_run impl_1
20- write_bitstream BitArgsPrefix [get_property DIRECTORY [current_run]]/[current_project] .bit BitArgsSuffix" > golden.txt
20+ write_bitstream BitArgsPrefix [get_property DIRECTORY [current_run]]/TopEntity .bit BitArgsSuffix" > golden.txt
2121
2222export HBS_TOOL=vivado-prj
2323../../../hbs dry-run core-c::src > output.txt
You can’t perform that action at this time.
0 commit comments