-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgen_docs.py
executable file
·59 lines (42 loc) · 1.19 KB
/
gen_docs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
import sys
import os
import markdown
# Ignore this. Only needed for this example
this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(this_dir, "./"))
from systemrdl import RDLCompiler, RDLCompileError
from ralbot.html import HTMLExporter
#===============================================================================
#input_file = sys.argv[1]
#output_dir = sys.argv[1]
output_dir = "./output"
#print(output_dir)
top = ['hi3516av200', 'hi3519v101']
#top = ['hi3519v101'] # top level address maps
roots = []
rdlc = RDLCompiler()
rdlc.compile_file('hi3516av200.rdl')
#rdlc.compile_file('hi3516cv300_family.rdl')
for addrspace in top:
root = rdlc.elaborate(addrspace)
roots.append(root.top)
htmlexporter = HTMLExporter()
htmlexporter.export(roots, output_dir)
#rdlc = RDLCompiler()
#try:
#for input_file in input_files:
# rdlc.compile_file(input_file)
# root = rdlc.elaborate()
#except RDLCompileError:
# sys.exit(1)
#md = markdown.Markdown(
# extensions=['admonition']
#)
#html = HTMLExporter(markdown_inst=md)
#html = HTMLExporter()
#html.export(
# root,
# os.path.join(this_dir, output_dir),
# home_url="/"
#)