Skip to content
Snippets Groups Projects
Commit eb9e6f1b authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Added script to convert Roy Smits's HEX format to INTEL HEX format used

 by our block generator as default RAM contents.
parent 2695233f
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
###############################################################################
#
# Copyright (C) 2016
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from common import *
from mem_init_file import list_to_hex
# Purpose:
# . Generate an INTEL HEX file to initialize our block generator RAM.
# Description:
# .
PATH = os.environ['RADIOHDL']+'/applications/arts/designs/arts_unb1_bg_offload/src/hex'
FILENAME = "arts_unb1_bg_offload_0"
###############################################################################
# Read the input file provided by Roy Smits; convert it to a list of integers
###############################################################################
with open('pulsar.hex') as f:
bg_list_str = [string.strip('\n') for string in f.readlines()]
###############################################################################
# Convert hex strings to integers and use this list for the block generator
###############################################################################
bg_list = [int(hex_str, 16) for hex_str in bg_list_str]
###############################################################################
# Write the HEX files
###############################################################################
MEM_WIDTH = 32 # 4 bytes
MEM_DEPTH = 32768 # 128kiB (8 M144Ks)
list_to_hex( bg_list, PATH+"/"+FILENAME+".hex", MEM_WIDTH, MEM_DEPTH)
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment