mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 01:32:49 -04:00
Added file necessary to split boot.mem into boot.mem and data.mem.
This commit is contained in:
parent
51f061ba35
commit
173562d6f4
1 changed files with 18 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue