Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SoCTools Flow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
SoCTools Flow
Commits
fa8ca0c8
Commit
fa8ca0c8
authored
1 year ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
SOC1-208
: Added scripts to generate html for different layers of heirarchy
parent
7118711f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/htmlgen/makefile
+1
-4
1 addition, 4 deletions
bin/htmlgen/makefile
bin/htmlgen/project_html_gen.py
+69
-0
69 additions, 0 deletions
bin/htmlgen/project_html_gen.py
tools/htmlgen
+13
-0
13 additions, 0 deletions
tools/htmlgen
with
83 additions
and
4 deletions
bin/htmlgen/makefile
+
1
−
4
View file @
fa8ca0c8
...
...
@@ -21,10 +21,7 @@ OUT_DIR ?= $(PROJECT_DIR)
# Name of generated filelist by python script
OUTPUT_FILELIST
:=
$(
OUT_DIR
)
/filelist.flist
bootrom
:
make
-C
$(
NANOSOC_TECH_DIR
)
/system bootrom
htmlgen
:
bootrom
gen_html
:
@
echo
building HTML tree
@
mkdir
-p
$(
OUT_DIR
)
/build
@
(
cd
$(
OUT_DIR
)
/build
;
\
...
...
This diff is collapsed.
Click to expand it.
bin/htmlgen/project_html_gen.py
0 → 100755
+
69
−
0
View file @
fa8ca0c8
#!/usr/bin/env python3
#------------------------------------------------------------------------------------
# HTML Project Generation Script
# - Generates HTML based on all filelist in PROJECT_DIR/flist/project
# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
#
# Contributors
#
# David Mapstone (d.a.mapstone@soton.ac.uk)
# Copyright (c) 2023, SoC Labs (www.soclabs.org)
#------------------------------------------------------------------------------------
import
argparse
import
subprocess
import
os
def
top_mod_find
(
filelist
):
# Open Filelist
f
=
open
(
filelist
,
"
r
"
)
filelines
=
f
.
readlines
()
f
.
close
()
# Iterate over file and find first match for DESIGN_TOP in file comments
for
line
in
filelines
:
line_list
=
line
.
strip
().
split
()
if
len
(
line_list
)
>
2
:
if
(
line_list
[
0
]
==
"
//
"
)
and
(
line_list
[
1
]
==
"
DESIGN_TOP
"
):
return
line_list
[
2
]
def
bootrom_gen
():
# Runs Bootrom generation script in NanoSoC Directory
bootrom_scipt_dir
=
os
.
getenv
(
"
NANOSOC_TECH_DIR
"
)
+
"
/system
"
subprocess
.
run
([
"
make
"
,
"
-C
"
,
bootrom_scipt_dir
,
"
bootrom
"
])
def
html_gen
(
filelist_path
):
filelist
=
os
.
path
.
basename
(
filelist_path
)
filelist_name
=
os
.
path
.
splitext
(
filelist
)[
0
]
print
(
"
Generating HTML for:
"
+
filelist_name
)
# Find Top-level module name
top_mod
=
top_mod_find
(
filelist_path
)
# Work out output Directory
outdir
=
os
.
getenv
(
"
PROJECT_DIR
"
)
+
"
/
"
+
filelist_name
+
"
/html
"
print
(
outdir
)
html_scipt_dir
=
os
.
getenv
(
"
SOCTOOLS_FLOW_DIR
"
)
+
"
/bin/htmlgen
"
subprocess
.
run
([
"
make
"
,
"
-C
"
,
html_scipt_dir
,
"
gen_html
"
,
"
TOP_MODULE=
"
+
top_mod
,
"
OUT_DIR=
"
+
outdir
])
def
project_gen
(
args
):
# Has filelist option been passed to script
if
args
.
filelist
==
None
:
# Generate bootrom
bootrom_gen
()
# Find all filelist in project filelist directory
for
filelist
in
os
.
listdir
(
os
.
getenv
(
"
PROJECT_DIR
"
)
+
"
/flist/project
"
):
filelist_path
=
os
.
getenv
(
"
PROJECT_DIR
"
)
+
"
/flist/project/
"
+
filelist
html_gen
(
filelist_path
)
else
:
if
args
.
bootrom
is
True
:
# Generate bootrom
bootrom_gen
()
# Generate HTML for given filelist
html_gen
(
args
.
filelist
)
if
__name__
==
"
__main__
"
:
# Capture Arguments from Command Line
parser
=
argparse
.
ArgumentParser
(
description
=
'
Generates HTML based on all filelist in PROJECT_DIR/flist/project
'
)
parser
.
add_argument
(
"
-f
"
,
"
--filelist
"
,
type
=
str
,
help
=
"
Generate only from this List
"
,
required
=
False
)
parser
.
add_argument
(
"
-b
"
,
"
--bootrom
"
,
action
=
'
store_true
'
,
help
=
"
Generate Bootrom first
"
,
required
=
False
)
parser
.
add_argument
(
"
-o
"
,
"
--output
"
,
type
=
str
,
help
=
"
Output Filelist location
"
,
required
=
False
)
args
=
parser
.
parse_args
()
project_gen
(
args
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tools/htmlgen
100644 → 100755
+
13
−
0
View file @
fa8ca0c8
#!/bin/bash
#-----------------------------------------------------------------------------
# HTML Generatoration Tools Script
# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
#
# Contributors
#
# David Mapstone (d.a.mapstone@soton.ac.uk)
#
# Copyright � 2021-3, SoC Labs (www.soclabs.org)
#-----------------------------------------------------------------------------
# Call Python script and pass options across
python3
$SOCTOOLS_FLOW_DIR
/bin/htmlgen/project_html_gen.py
$@
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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