mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-03 02:05:21 +00:00
Added file necessary to split boot.mem into boot.mem and data.mem.
This commit is contained in:
parent
83b0a83d5c
commit
ad9c98c19c
18
fpga/zsbl/splitfile.sh
Executable file
18
fpga/zsbl/splitfile.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
# Acquired from here.
|
||||||
|
# https://stackoverflow.com/questions/3066948/how-to-file-split-at-a-line-number
|
||||||
|
file_name=$1
|
||||||
|
|
||||||
|
# set first K lines:
|
||||||
|
K=512
|
||||||
|
|
||||||
|
# line count (N):
|
||||||
|
N=$(wc -l < $file_name)
|
||||||
|
|
||||||
|
# length of the bottom file:
|
||||||
|
L=$(( $N - $K ))
|
||||||
|
|
||||||
|
# create the top of file:
|
||||||
|
head -n $K $file_name > boot.mem
|
||||||
|
|
||||||
|
# create bottom of file:
|
||||||
|
tail -n $L $file_name > data.mem
|
Loading…
Reference in New Issue
Block a user