Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
263e7294
Commit
263e7294
authored
6 years ago
by
Florent Kermarrec
Browse files
Options
Download
Email Patches
Plain Diff
xilinx/programmer: add device parameter
parent
f71b4a8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
migen/build/xilinx/programmer.py
migen/build/xilinx/programmer.py
+25
-25
No files found.
migen/build/xilinx/programmer.py
View file @
263e7294
...
...
@@ -128,49 +128,49 @@ class VivadoProgrammer(GenericProgrammer):
self
.
vivado_ver
=
vivado_ver
self
.
flash_part
=
flash_part
def
load_bitstream
(
self
,
bitstream_file
,
target
=
""
):
def
load_bitstream
(
self
,
bitstream_file
,
target
=
""
,
device
=
0
):
cmds
=
"""open_hw
connect_hw_server
open_hw_target {target}
set_property PROBES.FILE {{}} [lindex [get_hw_devices]
0
]
set_property PROGRAM.FILE {{{bitstream}}} [lindex [get_hw_devices]
0
]
set_property PROBES.FILE {{}} [lindex [get_hw_devices]
{{{device}}}
]
set_property PROGRAM.FILE {{{bitstream}}} [lindex [get_hw_devices]
{{{device}}}
]
program_hw_devices [lindex [get_hw_devices]
0
]
refresh_hw_device [lindex [get_hw_devices]
0
]
program_hw_devices [lindex [get_hw_devices]
{{{device}}}
]
refresh_hw_device [lindex [get_hw_devices]
{{{device}}}
]
quit
"""
.
format
(
target
=
target
,
bitstream
=
bitstream_file
)
"""
.
format
(
target
=
target
,
bitstream
=
bitstream_file
,
device
=
device
)
_run_vivado
(
self
.
vivado_path
,
self
.
vivado_ver
,
cmds
)
# XXX works to flash bitstream, adapt it to flash bios
def
flash
(
self
,
address
,
data_file
):
def
flash
(
self
,
address
,
data_file
,
device
=
0
):
cmds
=
"""open_hw
connect_hw_server
open_hw_target
create_hw_cfgmem -hw_device [lindex [get_hw_devices]
0
] -mem_dev [lindex [get_cfgmem_parts {{{flash_part}}}] 0]
set_property PROGRAM.BLANK_CHECK 0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.ERASE 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.CFG_PROGRAM 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.VERIFY 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
refresh_hw_device [lindex [get_hw_devices]
0
]
set_property PROGRAM.ADDRESS_RANGE {{use_file}} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.FILES [list "{data}" ] [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.UNUSED_PIN_TERMINATION {{pull-none}} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.BLANK_CHECK 0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.ERASE 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.CFG_PROGRAM 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
set_property PROGRAM.VERIFY 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
create_hw_cfgmem -hw_device [lindex [get_hw_devices]
{{{device}}}
] -mem_dev [lindex [get_cfgmem_parts {{{flash_part}}}] 0]
set_property PROGRAM.BLANK_CHECK 0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.ERASE 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.CFG_PROGRAM 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.VERIFY 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
refresh_hw_device [lindex [get_hw_devices]
{{{device}}}
]
set_property PROGRAM.ADDRESS_RANGE {{use_file}} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.FILES [list "{data}" ] [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.UNUSED_PIN_TERMINATION {{pull-none}} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.BLANK_CHECK 0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.ERASE 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.CFG_PROGRAM 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
set_property PROGRAM.VERIFY 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
startgroup
if {{![string equal [get_property PROGRAM.HW_CFGMEM_TYPE [lindex [get_hw_devices]
0
]] [get_property MEM_TYPE [get_property CFGMEM_PART [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]]]] }} {{ create_hw_bitstream -hw_device [lindex [get_hw_devices]
0
] [get_property PROGRAM.HW_CFGMEM_BITFILE [ lindex [get_hw_devices]
0
]]; program_hw_devices [lindex [get_hw_devices]
0
]; }};
program_hw_cfgmem -hw_cfgmem [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
0
]]
if {{![string equal [get_property PROGRAM.HW_CFGMEM_TYPE [lindex [get_hw_devices]
{{{device}}}
]] [get_property MEM_TYPE [get_property CFGMEM_PART [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]]]] }} {{ create_hw_bitstream -hw_device [lindex [get_hw_devices]
{{{device}}}
] [get_property PROGRAM.HW_CFGMEM_BITFILE [ lindex [get_hw_devices]
{{{device}}}
]]; program_hw_devices [lindex [get_hw_devices]
{{{device}}}
]; }};
program_hw_cfgmem -hw_cfgmem [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices]
{{{device}}}
]]
endgroup
quit
"""
.
format
(
data
=
data_file
,
flash_part
=
self
.
flash_part
)
"""
.
format
(
data
=
data_file
,
flash_part
=
self
.
flash_part
,
device
=
device
)
_run_vivado
(
self
.
vivado_path
,
self
.
vivado_ver
,
cmds
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment