Commit 0e0fd10c authored by Théotime BOLLENGIER's avatar Théotime BOLLENGIER
Browse files

bitmask

parent 1004d30e
......@@ -82,9 +82,8 @@ module ArGen
def extract_bitmask_wrapped_for_SPI_wrapper
outmap = '1'*(output_state_arr.reverse.join
nVTPR = (get_longest_path_length_fast(quiet: true) - 1).to_s(2).rjust(8, '0')
outmap = '1'*@vFpgaNbIoPins
nVTPR = '1'*8
return nVTPR + outmap + extract_bitmask()
end
......@@ -253,6 +252,15 @@ module ArGen
end
end # extract_bitstream_wrapped
def extract_bitmask_wrapped(withReorderingConfig: true)
if withReorderingConfig then
return extract_bitmask() + '1'*(Math.log2(@vFpgaNbIoPins + 1).ceil * @vFpgaNbIoPins * 2)
else
return extract_bitmask()
end
end
end # Arch
......
......@@ -165,6 +165,31 @@ if (options[:bitstream] or options[:ioloc]) and options[:wrapper] == :raw then
end
if options[:bitmask] then
if options[:wrapper] == :wishbone then
bitmask = arch.extract_bitmask_wrapped(withReorderingConfig: options[:reordering_ring])
if options[:hex] then
ArGen::Architecture::format_bit_string_to_hexa_bit_string(bitmask, options[:bitmask])
else
ArGen::Architecture::format_bit_string_to_binary_bitstream(bitmask, options[:bitmask])
end
puts "#{options[:hex] ? 'Hexadecimal' : 'Binary'} bitmask written to file \"#{options[:bitmask]}\""
elsif options[:wrapper] == :efpga or options[:wrapper] == :none then
bitmask = arch.extract_bitmask_wrapped_for_SPI_wrapper()
if options[:hex] then
ArGen::Architecture::format_bit_string_to_hexa_bit_string_for_SPI_wrapper(bitmask, options[:bitmask])
else
ArGen::Architecture::format_bit_string_to_binary_bitstream_for_SPI_wrapper(bitmask, options[:bitmask])
end
puts "#{options[:hex] ? 'Hexadecimal' : 'Binary'} bitmask written to file \"#{options[:bitmask]}\""
elsif options[:wrapper] == :raw then
bitmask = arch.extract_bitmask_wrapped(withReorderingConfig: false)
ArGen::Architecture::format_bit_string_to_raw_binary_bitstream(bitmask, options[:bitmask])
puts "Raw binary bitmask written to file \"#{options[:bitmask]}\""
end
end
if options[:snapshot] then
abort "ERROR: --hex cannot be used with --wrapper=raw" if (options[:hex] and options[:wrapper] == :raw)
puts "Extracting initialization snapshot..."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment