[Init] initialize repo

This commit is contained in:
bLueriVerLHR
2023-05-11 12:33:10 +08:00
parent 7647279185
commit f86bda7b50
7 changed files with 37 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
build/

26
CMakeLists.txt Normal file
View File

@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0074 NEW)
project(lacpu)
# set environment variables for verilator
# remove if already install one
set(verilator_DIR "/home/blur/gits/verilator")
set(ENV{VERILATOR_ROOT} ${verilator_DIR})
find_package(verilator)
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found.")
endif()
# set default top module as top file
set(VSRC ${CMAKE_SOURCE_DIR}/vsrc/top.v)
# get all cxx source files from cxxsrc
file(GLOB_RECURSE CXXSRC ${CMAKE_SOURCE_DIR}/cxxsrc/*.cc)
add_executable(${CMAKE_PROJECT_NAME} ${CXXSRC})
verilate(${CMAKE_PROJECT_NAME}
INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/vsrc ${verilator_DIR}/include
SOURCES ${VSRC})

View File

@@ -1,2 +1,3 @@
# neulacpu # neulacpu
loongarch cpu development repo loongarch cpu development repo

3
cxxsrc/main.cc Normal file
View File

@@ -0,0 +1,3 @@
int main() {
return 0;
}

0
cxxsrc/spec.cc Normal file
View File

0
cxxsrc/spec.hh Normal file
View File

6
vsrc/top.v Normal file
View File

@@ -0,0 +1,6 @@
module top (
input wire i_x,
output wire o_y
);
assign o_y = i_x;
endmodule