Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
592bcdab
Commit
592bcdab
authored
Nov 21, 2022
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
module.py: handle libraries in explicit dependencies
parent
44bef590
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
module.py
hdlmake/module/module.py
+14
-7
dep_file.py
hdlmake/sourcefiles/dep_file.py
+15
-2
No files found.
hdlmake/module/module.py
View file @
592bcdab
...
...
@@ -179,11 +179,15 @@ class Module(object):
for
filepath
in
list_of_paths
:
if
isinstance
(
filepath
,
tuple
):
# A tuple of the form (filename, provide [, dependencies])
# Filename is a string, but provide and dependencies are string or list.
files
=
self
.
_check_filepath
(
filepath
[
0
])
assert
len
(
files
)
==
1
files
.
append
(
path_mod
.
flatten_list
(
filepath
[
1
]))
files
.
extend
(
list
(
filepath
[
2
:]))
paths
.
append
(
tuple
(
files
))
prov
=
path_mod
.
flatten_list
(
filepath
[
1
])
if
len
(
filepath
)
==
2
:
req
=
[]
else
:
req
=
path_mod
.
flatten_list
(
filepath
[
2
])
paths
.
append
((
files
[
0
],
prov
,
req
))
else
:
files
=
self
.
_check_filepath
(
filepath
)
for
f
in
files
:
...
...
@@ -209,7 +213,8 @@ class Module(object):
assert
1
<
len
(
path
)
<
4
pathname
=
path
[
0
]
provide
=
path
[
1
]
depends
=
path
[
2
]
if
len
(
path
)
>
2
else
[]
depends
=
path
[
2
]
print
(
path
)
srcs
.
add
(
create_source_file_with_deps
(
path
=
pathname
,
module
=
self
,
provide
=
provide
,
...
...
@@ -241,14 +246,16 @@ class Module(object):
return
# Be sure it is a list.
files
=
path_mod
.
flatten_list
(
files
)
print
(
files
)
# Remove duplicates
files_set
=
set
()
nfiles
=
[]
for
f
in
files
:
if
f
in
files_set
:
logging
.
warning
(
"file
%
s appear twice in Manifest
%
s"
,
f
,
self
.
path
)
fname
=
f
[
0
]
if
isinstance
(
f
,
tuple
)
else
f
if
fname
in
files_set
:
logging
.
warning
(
"file
%
s appear twice in Manifest
%
s"
,
fname
,
self
.
path
)
else
:
files_set
.
add
(
f
)
files_set
.
add
(
f
name
)
nfiles
.
append
(
f
)
# Convert to paths
self
.
manifest_dict
[
"files"
]
=
nfiles
...
...
hdlmake/sourcefiles/dep_file.py
View file @
592bcdab
...
...
@@ -216,8 +216,21 @@ class ManualFile(DepFile):
self
.
provide_units
=
provide
self
.
depends_units
=
depends
def
extract
(
self
,
unit
):
u
=
unit
.
split
(
'.'
)
if
len
(
u
)
==
1
:
ent
=
u
[
0
]
lib
=
self
.
library
else
:
assert
(
len
(
u
)
==
2
)
lib
=
u
[
0
]
ent
=
u
[
1
]
return
(
ent
,
lib
)
def
parse
(
self
,
graph
):
for
unit
in
self
.
provide_units
:
graph
.
add_provide
(
self
,
DepRelation
(
unit
,
self
.
library
,
DepRelation
.
ENTITY
))
(
ent
,
lib
)
=
self
.
extract
(
unit
)
graph
.
add_provide
(
self
,
DepRelation
(
ent
,
lib
,
DepRelation
.
ENTITY
))
for
unit
in
self
.
depends_units
:
graph
.
add_require
(
self
,
DepRelation
(
unit
,
self
.
library
,
DepRelation
.
ENTITY
))
(
ent
,
lib
)
=
self
.
extract
(
unit
)
graph
.
add_require
(
self
,
DepRelation
(
ent
,
lib
,
DepRelation
.
ENTITY
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment