Skip to content

Commit 26f6e89

Browse files
committed
Added symlink creation
1 parent 0a6c48a commit 26f6e89

4 files changed

Lines changed: 31 additions & 15 deletions

File tree

config/pegasus.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ilimit : 10000
2+
params: {top.core0.params.isa: "rv64imafdcbv_zicsr_zifencei_zbkx"}
3+
pegasus_loggers: []
4+
db_file: "pegasus-cosim-work.db"
5+
snapshot_threshold: 1000

core/edm/CMakeLists.txt

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "pegasus" OR NOT D
1717

1818
message(STATUS "EDM: Fetching Pegasus into ${CMAKE_SOURCE_DIR}/core/edm/adapters/Pegasus/pegasus")
1919

20-
set(PEGASUS_USE_PARENT_MAVIS TRUE CACHE BOOL "" FORCE)
21-
set(PEGASUS_USE_PARENT_STF_LIB TRUE CACHE BOOL "" FORCE)
20+
set(PEGASUS_USE_PARENT_MAVIS TRUE CACHE BOOL "" FORCE)
21+
set(PEGASUS_USE_PARENT_STF_LIB TRUE CACHE BOOL "" FORCE)
2222
set(PEGASUS_USE_PARENT_SOFTFLOAT TRUE CACHE BOOL "" FORCE)
2323
set(FetchContent_Quiet FALSE)
2424

2525
fetchcontent_declare(pegasus
2626
GIT_REPOSITORY https://github.com/sparcians/pegasus.git
27-
GIT_TAG f6231b7
27+
GIT_TAG f6231b7
2828
USES_TERMINAL_DOWNLOAD TRUE
29-
USES_TERMINAL_UPDATE TRUE
30-
SOURCE_DIR ${CMAKE_SOURCE_DIR}/core/edm/adapters/Pegasus/pegasus
29+
USES_TERMINAL_UPDATE TRUE
30+
SOURCE_DIR ${CMAKE_SOURCE_DIR}/core/edm/adapters/Pegasus/pegasus
3131
)
3232

3333
fetchcontent_getproperties(pegasus)
@@ -36,7 +36,6 @@ if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "pegasus" OR NOT D
3636
message(STATUS "EDM: Pegasus source dir: ${pegasus_SOURCE_DIR}")
3737
include("${pegasus_SOURCE_DIR}/stf_lib/cmake/lto.cmake")
3838
include_directories(${CMAKE_BINARY_DIR}/_deps/bitset2-src)
39-
# Set softfloat defines globally before Pegasus targets are created
4039
add_compile_definitions(
4140
SOFTFLOAT_FAST_INT64
4241
SOFTFLOAT_FAST_DIV32TO16
@@ -45,13 +44,16 @@ if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "pegasus" OR NOT D
4544
SOFTFLOAT_BUILTIN_CLZ=1
4645
SOFTFLOAT_INTRINSIC_INT128=1
4746
)
48-
4947
add_subdirectory(${pegasus_SOURCE_DIR} ${pegasus_BINARY_DIR})
5048
endif()
5149

52-
add_compile_options(-isystem ${CMAKE_BINARY_DIR}/mavis/softfloat_build-prefix/src/softfloat_build/source/include)
53-
add_compile_options(-isystem ${CMAKE_BINARY_DIR}/mavis/softfloat_build-prefix/src/softfloat_build/source/RISCV)
50+
add_compile_options(-isystem ${CMAKE_BINARY_DIR}/mavis/softfloat_build-prefix/src/softfloat_build/source/include)
51+
add_compile_options(-isystem ${CMAKE_BINARY_DIR}/mavis/softfloat_build-prefix/src/softfloat_build/source/RISCV)
5452

53+
# Symlink pegasus sim artifacts into the build root
54+
file(CREATE_LINK ${CMAKE_BINARY_DIR}/_deps/pegasus-build/sim/mavis_json ${CMAKE_BINARY_DIR}/mavis_json SYMBOLIC)
55+
file(CREATE_LINK ${CMAKE_BINARY_DIR}/_deps/pegasus-build/sim/arch ${CMAKE_BINARY_DIR}/arch SYMBOLIC)
56+
file(CREATE_LINK ${CMAKE_SOURCE_DIR}/config ${CMAKE_BINARY_DIR}/config SYMBOLIC)
5557

5658
add_dependencies(pegasuslibs softfloat_build)
5759

@@ -64,9 +66,9 @@ if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "whisper" OR NOT D
6466

6567
fetchcontent_declare(whisper
6668
GIT_REPOSITORY https://github.com/tenstorrent/whisper.git
67-
GIT_TAG master
68-
GIT_SHALLOW TRUE
69-
GIT_PROGRESS TRUE
69+
GIT_TAG master
70+
GIT_SHALLOW TRUE
71+
GIT_PROGRESS TRUE
7072
)
7173
fetchcontent_makeavailable(whisper)
7274

@@ -87,11 +89,17 @@ if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "pegasus" OR NOT D
8789
${PEGASUS_SOURCE_DIR}/include
8890
)
8991
target_link_libraries(edm PUBLIC pegasuslibs pegasuscosimlib)
90-
target_compile_definitions(edm PUBLIC PEGASUS_AVAILABLE)
92+
target_compile_definitions(edm PUBLIC
93+
PEGASUS_AVAILABLE
94+
DEFAULT_PEGASUS
95+
)
9196
endif()
9297

9398
## whisper
9499
if(DEFAULT_BACKEND STREQUAL "all" OR DEFAULT_BACKEND STREQUAL "whisper" OR NOT DEFAULT_BACKEND)
95100
target_link_libraries(edm PUBLIC whisper)
96-
target_compile_definitions(edm PUBLIC WHISPER_AVAILABLE)
101+
target_compile_definitions(edm PUBLIC
102+
WHISPER_AVAILABLE
103+
DEFAULT_WHISPER
104+
)
97105
endif()

core/edm/EDMFactory.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#include <sparta/utils/SpartaAssert.hpp>
22

33
#include "EDMFactory.hpp"
4+
5+
#ifdef PEGASUS_AVAILABLE
46
#include "Pegasus.hpp"
7+
#endif
58

69
namespace olympia::edm
710
{

sim/OlympiaSim.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ OlympiaSim::OlympiaSim(sparta::Scheduler & scheduler,
2626
show_factories_(show_factories)
2727
{
2828
// Set up the CPU Resource Factory to be available through ResourceTreeNode
29-
#ifdef EDM_ENABLED
29+
#ifdef PEGASUS_AVAILABLE
3030
sparta::SleeperThread::disableForever();
3131
#endif
3232
getResourceSet()->addResourceFactory<olympia::CPUFactory>();

0 commit comments

Comments
 (0)