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
0c0a06d8
Commit
0c0a06d8
authored
Sep 16, 2014
by
garcialasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relocate XilinxsiminiReader Class
parent
8effe74c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
74 deletions
+81
-74
__main__.py
hdlmake/__main__.py
+2
-2
ise.py
hdlmake/tools/ise/ise.py
+0
-71
isim.py
hdlmake/tools/isim/isim.py
+79
-1
No files found.
hdlmake/__main__.py
View file @
0c0a06d8
...
...
@@ -37,7 +37,7 @@ from action import (CheckCondition, CleanModules, FetchModules, GenerateFetchMak
ListModules
,
MergeCores
,
GenerateSimulationMakefile
,
GenerateSynthesisMakefile
,
GenerateRemoteSynthesisMakefile
,
GenerateSynthesisProject
)
from
argument_parser
import
get_argument_parser
#
from argument_parser import get_argument_parser
#try:
# from build_hash import BUILD_ID
...
...
@@ -150,7 +150,7 @@ def main():
logging
.
error
(
"`sim_tool' manifest variable has to be specified. "
"Otherwise hdlmake doesn't know how to simulate the project"
)
quit
()
action
=
GenerateSimulationMakefile
action
=
[
GenerateSimulationMakefile
]
elif
top_mod
.
action
==
"synthesis"
:
if
not
top_mod
.
syn_tool
:
logging
.
error
(
"`syn_tool' manifest variable has to be specified. "
...
...
hdlmake/tools/ise/ise.py
View file @
0c0a06d8
...
...
@@ -564,74 +564,3 @@ class ISEProjectProperty:
return
prop
class
XilinxsiminiReader
(
object
):
def
__init__
(
self
,
path
=
None
):
if
path
is
None
:
path
=
self
.
xilinxsim_ini_dir
()
+
"/xilinxsim.ini"
self
.
path
=
path
# Parse the xilinxsim.ini file to get the referenced libraries
def
get_libraries
(
self
):
libs
=
[]
try
:
ini
=
open
(
self
.
path
,
"r"
)
except
Exception
:
raise
RuntimeError
(
"Can't open existing xilinxsim.ini file"
)
#p.info("Reading 'xilinxsim.ini' located in: '"+ str(self.path))
# Read loggical libraries name, skipping comments and other
#possible sections
for
line
in
ini
:
# Read line by line, skipping comments and striping newline
line
=
line
.
split
(
'--'
)[
0
]
.
strip
()
# Still in comments section
if
line
==
""
:
continue
# Not in comments section. Library section:
#<logical_library> = <phisical_path>
line
=
line
.
split
(
'='
)
lib
=
line
[
0
]
.
strip
()
libs
.
append
(
lib
.
lower
())
return
libs
@
staticmethod
def
xilinxsim_ini_dir
():
# Does not really need this
# try:
# host_platform = os.environ["HOST_PLATFORM"]
# except KeyError:
# logging.error("Please set the environment variable HOST_PLATFORM")
# quit()
#if global_mod.env["xilinx"]:
# xilinx_dir = global_mod.env["xilinx"]
if
global_mod
.
env
[
"isim_path"
]:
xilinx_dir
=
str
(
os
.
path
.
join
(
global_mod
.
env
[
"isim_path"
],
".."
,
".."
))
else
:
logging
.
error
(
"Cannot calculate xilinx tools base directory"
)
quit
()
hdl_language
=
'vhdl'
#'verilog'
if
sys
.
platform
==
'cygwin'
:
os_prefix
=
'nt'
else
:
os_prefix
=
'lin'
if
global_mod
.
env
[
"architecture"
]
==
32
:
arch_sufix
=
''
else
:
arch_sufix
=
'64'
xilinx_ini_path
=
str
(
os
.
path
.
join
(
xilinx_dir
,
hdl_language
,
"hdp"
,
os_prefix
+
arch_sufix
))
# Ensure the path is absolute and normalized
return
os
.
path
.
abspath
(
xilinx_ini_path
)
hdlmake/tools/isim/isim.py
View file @
0c0a06d8
...
...
@@ -26,9 +26,13 @@
import
os.path
from
subprocess
import
Popen
,
PIPE
import
os
import
sys
import
string
from
string
import
Template
import
fetch
import
global_mod
from
makefile_writer
import
MakefileWriter
...
...
@@ -69,7 +73,7 @@ class ToolControls(MakefileWriter):
def
generate_simulation_makefile
(
self
,
fileset
,
top_module
):
from
srcfile
import
VerilogFile
,
VHDLFile
from
tools.ise
import
XilinxsiminiReader
#
from tools.ise import XilinxsiminiReader
make_preambule_p1
=
"""## variables #############################
PWD := $(shell pwd)
TOP_MODULE := """
+
top_module
.
top_module
+
"""
...
...
@@ -236,3 +240,77 @@ isim.wdb isim_proj isim_proj.*
else
:
skip
=
True
return
' '
.
join
(
ret
)
class
XilinxsiminiReader
(
object
):
def
__init__
(
self
,
path
=
None
):
if
path
is
None
:
path
=
self
.
xilinxsim_ini_dir
()
+
"/xilinxsim.ini"
self
.
path
=
path
# Parse the xilinxsim.ini file to get the referenced libraries
def
get_libraries
(
self
):
libs
=
[]
try
:
ini
=
open
(
self
.
path
,
"r"
)
except
Exception
:
raise
RuntimeError
(
"Can't open existing xilinxsim.ini file"
)
#p.info("Reading 'xilinxsim.ini' located in: '"+ str(self.path))
# Read loggical libraries name, skipping comments and other
#possible sections
for
line
in
ini
:
# Read line by line, skipping comments and striping newline
line
=
line
.
split
(
'--'
)[
0
]
.
strip
()
# Still in comments section
if
line
==
""
:
continue
# Not in comments section. Library section:
#<logical_library> = <phisical_path>
line
=
line
.
split
(
'='
)
lib
=
line
[
0
]
.
strip
()
libs
.
append
(
lib
.
lower
())
return
libs
@
staticmethod
def
xilinxsim_ini_dir
():
# Does not really need this
# try:
# host_platform = os.environ["HOST_PLATFORM"]
# except KeyError:
# logging.error("Please set the environment variable HOST_PLATFORM")
# quit()
#if global_mod.env["xilinx"]:
# xilinx_dir = global_mod.env["xilinx"]
if
global_mod
.
env
[
"isim_path"
]:
xilinx_dir
=
str
(
os
.
path
.
join
(
global_mod
.
env
[
"isim_path"
],
".."
,
".."
))
else
:
logging
.
error
(
"Cannot calculate xilinx tools base directory"
)
quit
()
hdl_language
=
'vhdl'
#'verilog'
if
sys
.
platform
==
'cygwin'
:
os_prefix
=
'nt'
else
:
os_prefix
=
'lin'
if
global_mod
.
env
[
"architecture"
]
==
32
:
arch_sufix
=
''
else
:
arch_sufix
=
'64'
xilinx_ini_path
=
str
(
os
.
path
.
join
(
xilinx_dir
,
hdl_language
,
"hdp"
,
os_prefix
+
arch_sufix
))
# Ensure the path is absolute and normalized
return
os
.
path
.
abspath
(
xilinx_ini_path
)
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