-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xcelium SystemC support issue #126
- Loading branch information
Showing
17 changed files
with
319 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 15 additions & 13 deletions
28
examples/simple_mixed_language_sc_vlog/counter1/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
|
||
add_ip(counter1) | ||
|
||
if(DUT_LANG STREQUAL "verilog") | ||
add_ip(counter1) | ||
ip_sources(${IP} VERILOG | ||
vlog/counter1.v | ||
) | ||
elseif(DUT_LANG STREQUAL "systemc") | ||
ip_sources(${IP} SYSTEMC | ||
HEADERS | ||
sc/counter1.h | ||
) | ||
endif() | ||
if(SIMULATOR STREQUAL "xcelium" OR SIMULATOR STREQUAL "osci") | ||
set(IP counter1) | ||
add_library(${IP} INTERFACE) | ||
target_include_directories(${IP} INTERFACE ./sc) | ||
|
||
ip_include_directories(${IP} SYSTEMC | ||
sc | ||
) | ||
target_include_directories(${IP} INTERFACE | ||
sc | ||
) | ||
# For now Questa uses SoCMake IP block for SystemC | ||
elseif(SIMULATOR STREQUAL "mgc") | ||
add_ip(counter1) | ||
ip_sources(${IP} SYSTEMC | ||
HEADERS | ||
sc/counter1.h | ||
) | ||
ip_include_directories(${IP} SYSTEMC ./sc) | ||
endif() | ||
endif() |
28 changes: 15 additions & 13 deletions
28
examples/simple_mixed_language_sc_vlog/counter2/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
add_ip(counter2) | ||
|
||
if(DUT_LANG STREQUAL "verilog") | ||
add_ip(counter2) | ||
ip_sources(${IP} VERILOG | ||
vlog/counter2.v | ||
) | ||
elseif(DUT_LANG STREQUAL "systemc") | ||
ip_sources(${IP} SYSTEMC | ||
HEADERS | ||
sc/counter2.h | ||
) | ||
endif() | ||
|
||
ip_include_directories(${IP} SYSTEMC | ||
sc | ||
) | ||
target_include_directories(${IP} INTERFACE | ||
sc | ||
) | ||
if(SIMULATOR STREQUAL "xcelium" OR SIMULATOR STREQUAL "osci") | ||
set(IP counter2) | ||
add_library(${IP} INTERFACE) | ||
target_include_directories(${IP} INTERFACE ./sc) | ||
|
||
# For now Questa uses SoCMake IP block for SystemC | ||
elseif(SIMULATOR STREQUAL "mgc") | ||
add_ip(counter2) | ||
ip_sources(${IP} SYSTEMC | ||
HEADERS | ||
sc/counter2.h | ||
) | ||
ip_include_directories(${IP} SYSTEMC ./sc) | ||
endif() | ||
endif() |
55 changes: 41 additions & 14 deletions
55
examples/simple_mixed_language_sc_vlog/counters/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,56 @@ | ||
add_ip(counters) | ||
|
||
if(DUT_LANG STREQUAL "verilog") | ||
add_ip(counters) | ||
ip_sources(${IP} VERILOG | ||
vlog/counters.v | ||
) | ||
if(SIMULATOR STREQUAL "xcelium") | ||
target_include_directories(${IP} INTERFACE ./sc/xcelium_shell/) | ||
elseif(SIMULATOR STREQUAL "mgc") | ||
ip_include_directories(${IP} SYSTEMC ./sc/mgc_shell/) | ||
endif() | ||
|
||
elseif(DUT_LANG STREQUAL "systemc") | ||
ip_sources(${IP} SYSTEMC | ||
sc/counters.cpp | ||
HEADERS | ||
sc/counters.h | ||
) | ||
endif() | ||
|
||
ip_include_directories(${IP} SYSTEMC | ||
sc | ||
) | ||
target_include_directories(${IP} INTERFACE | ||
sc | ||
) | ||
if(SIMULATOR STREQUAL "xcelium" OR SIMULATOR STREQUAL "osci") | ||
set(IP counters) | ||
add_library(${IP} OBJECT | ||
./sc/counters.cpp | ||
) | ||
|
||
# This is Verilog shell for SystemC module, can be generated with xmshell | ||
ip_sources(${IP} VERILOG | ||
./vlog/xcelium_shell/counters.v | ||
) | ||
|
||
set_target_properties(${IP} | ||
PROPERTIES | ||
SOCMAKE_CXX_LIBRARY_TYPE SYSTEMC | ||
POSITION_INDEPENDENT_CODE TRUE | ||
) | ||
|
||
target_include_directories(${IP} INTERFACE ./sc) | ||
elseif(SIMULATOR STREQUAL "mgc") | ||
add_ip(counters) | ||
ip_sources(${IP} SYSTEMC | ||
sc/counters.cpp | ||
HEADERS | ||
sc/counters.h | ||
) | ||
ip_include_directories(${IP} SYSTEMC ./sc) | ||
endif() | ||
endif() | ||
|
||
add_subdirectory(../counter1/ "counter1") | ||
add_subdirectory(../counter2/ "counter2") | ||
|
||
ip_link(${IP} | ||
ip_link(${IP} | ||
counter1 | ||
counter2 | ||
) | ||
|
||
if(DUT_LANG STREQUAL "systemc" AND (SIMULATOR STREQUAL "xcelium" OR SIMULATOR STREQUAL "osci")) | ||
target_link_libraries(${IP} PUBLIC | ||
counter1 | ||
counter2) | ||
endif() |
Oops, something went wrong.