Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
87
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
d8d928a7
Commit
d8d928a7
authored
14 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
wbgen-regs: new Makefile to build them
parent
50d73135
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wbgen-regs/Makefile
+42
-0
42 additions, 0 deletions
wbgen-regs/Makefile
wbgen-regs/README
+20
-23
20 additions, 23 deletions
wbgen-regs/README
with
62 additions
and
23 deletions
wbgen-regs/Makefile
0 → 100644
+
42
−
0
View file @
d8d928a7
# This Makefile is used to reproduce the headers from svn checkout.
# You need to have "wbgen2" in your command search path and the white-rabbit
# svn checkout in $SVN. Since this is only meant to be used by me,
# no serious checking is done
# List of input files in SVN checkout
MODULES
=
$(
SVN
)
/trunk/hdl/modules
SPECS
=
$(
SVN
)
/trunk/documentation/specifications
WB_ENDPOINT
=
$(
MODULES
)
/wrsw_endpoint/ep_wishbone_controller.wb
WB_PPSG
=
$(
MODULES
)
/wrsw_pps_gen/wrsw_pps_gen.wb
WB_CALIB
=
$(
MODULES
)
/wrsw_calibrator_dmtd/wrsw_calibrator_dmtd.wb
WB_TSTAMP
=
$(
MODULES
)
/wrsw_txtsu/wrsw_txtsu.wb
WB_NIC
=
$(
SPECS
)
/hdlspec/WRSW_wbc_internal_NIC/wr_nic.wb
HEADERS
=
endpoint-regs.h ppsg-regs.h calib-regs.h tstamp-regs.h nic-regs.h
WBINPUT
=
$(
HEADERS:.h
=
wb
)
# No default, for people who types "make" everywhere (like me)
all
:
@
echo
"This is for developer's use, see Makefile for details"
exit
1
# The headers rule regenerates headers from local wb files
headers
:
$(HEADERS)
%.h
:
%.wb
wbgen2
--cstyle
=
struct
--co
=
$@
$<
sed
-i
's,inttypes.h,linux/types.h,'
$@
sed
-i
'/ Created *: .*20[0-9][0-9]$$/ d'
$@
sed
-i
's/-REGS_WB//'
$@
# The wbinput rule just copies here stuff from svn.
# Do it silent so errors stand out
wbinput
:
@
cp
$(
WB_ENDPOINT
)
endpoint-regs.wb
@
cp
$(
WB_PPSG
)
ppsg-regs.wb
@
cp
$(
WB_CALIB
)
calib-regs.wb
@
cp
$(
WB_TSTAMP
)
tstamp-regs.wb
@
cp
$(
WB_NIC
)
nic-regs.wb
@
echo
"Copied input files from subversions to local directory"
This diff is collapsed.
Click to expand it.
wbgen-regs/README
+
20
−
23
View file @
d8d928a7
...
...
@@ -6,26 +6,23 @@ In that directory you find the html generated from the wb files.
Here I import the relevant headers. The overall register
map is in ../nic/nic-hardware.h .
These are the commands I used after copying all the '*.wb' files here
(wbgen2 has currently a problem with pathname-prefixed file names):
# map wb names to header names
src_endpoint="wrsw_pps_gen.wb"
src_ppsg="wrsw_pps_gen.wb"
src_calib="wrsw_calibrator_dmtd.wb"
src_nic="wr_nic.wb"
src_tstamp="wrsw_txtsu.wb"
# all but nic-regs
for n in endpoint ppsg calib tstamp; do
out=${n}-regs.h
eval in=\$src_$n
wbgen2 --cstyle=struct --co=$out $in
# fix the <inttypes.h> stuff, which we miss in the kerenel
sed -i 's,inttypes.h,linux/types.h,' $out
done
# note: this must be hand-edited, and it has (see git log)
wbgen2 --cstyle=struct --co=nic-regs.h $src_nic
sed -i 's,inttypes.h,linux/types.h,' nic-regs.h
The .wb files whence the headers are generated come from different
plases in the white rabbit svn. To ease myself I wrote this in
the Makefile. You can "make wbinput" to get a fresh copy of them,
provided you have SVN set in your environment (point to the root
checkout, before "trunk" subdirectory). If unset or wrong, cp fails.
With "make headers" you can regenerate the headers from the wb input
files. Each generated file is postprocesses with sed to fix these
issues:
* generated files include <inttypes.h> as they use uint32_t. We want
<linux/types.h> instead, as no <inttypes.h> nor <stdint.h> is there
* generated files include the date of creation. This brings to noise
in the "git diff" or plain "diff", so I'd better have no date.
* creation of "#ifdef __THIS_HEADER__" fails on the dash, so I remove
the dash and trailing part with sed (as of writing, it has issues with
pathnames too, this is one the reasons why I copy the wb here first).
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment