Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
40546917
Commit
40546917
authored
Mar 03, 2023
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
May 09, 2023
Browse files
sims/external/simics: add SimBricks memory adapter
parent
8422c890
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1158 additions
and
2 deletions
+1158
-2
sims/external/simics/.gitignore
sims/external/simics/.gitignore
+1
-0
sims/external/simics/.package-list
sims/external/simics/.package-list
+2
-0
sims/external/simics/modules/simbricks-mem/Makefile
sims/external/simics/modules/simbricks-mem/Makefile
+22
-0
sims/external/simics/modules/simbricks-mem/module_load.py
sims/external/simics/modules/simbricks-mem/module_load.py
+45
-0
sims/external/simics/modules/simbricks-mem/simbricks_mem.c
sims/external/simics/modules/simbricks-mem/simbricks_mem.c
+998
-0
sims/external/simics/modules/simbricks-mem/simbricks_mem_comp.py
...ternal/simics/modules/simbricks-mem/simbricks_mem_comp.py
+74
-0
sims/external/simics/rules.mk
sims/external/simics/rules.mk
+16
-2
No files found.
sims/external/simics/.gitignore
View file @
40546917
...
...
@@ -2,5 +2,6 @@ installdir/
intel-simics-package-manager*.tar.gz
latest
package-manager/
project/
ready
simics-6-packages*.ispm
sims/external/simics/.package-list
0 → 100644
View file @
40546917
../simics-qsp-x86-6.0.65
../simics-qsp-cpu-6.0.12
sims/external/simics/modules/simbricks-mem/Makefile
0 → 100644
View file @
40546917
# -*- Makefile ; coding: utf-8 -*-
# Simics module makefile
MODULE_CLASSES
=
simbricks_mem
MODULE_COMPONENTS
=
simbricks_mem_comp
SRC_FILES
=
simbricks_mem.c
PYTHON_FILES
=
simbricks_mem_comp.py module_load.py
# SIMBRICKS_LIB needs to be set by caller
MODULE_CFLAGS
:=
-I
"
$(SIMBRICKS_LIB)
"
MODULE_LDFLAGS
:=
-L
"
$(SIMBRICKS_LIB)
"
-lsimbricks
SIMICS_API
:=
6
THREAD_SAFE
:=
yes
ifeq
($(MODULE_MAKEFILE),)
$(error
Make
sure
you
compile
your
module
from
the
project
directory)
else
include
$(MODULE_MAKEFILE)
endif
sims/external/simics/modules/simbricks-mem/module_load.py
0 → 100644
View file @
40546917
# Copyright (c) 2020-2023 Max Planck Institute for Software Systems
# Copyright (c) 2020-2023 National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
import
cli
class_name
=
'simbricks_mem'
# info command prints static information
def
get_info
(
obj
):
return
[]
# status command prints dynamic information
def
get_status
(
obj
):
return
[(
'Attributes'
,
[(
'socket'
,
obj
.
socket
),
(
'mem_latency'
,
obj
.
mem_latency
),
(
'sync_period'
,
obj
.
sync_period
)]
)]
cli
.
new_info_command
(
class_name
,
get_info
)
cli
.
new_status_command
(
class_name
,
get_status
)
from
.
import
simbricks_mem_comp
simbricks_mem_comp
.
simbricks_mem_comp
.
register
()
sims/external/simics/modules/simbricks-mem/simbricks_mem.c
0 → 100644
View file @
40546917
This diff is collapsed.
Click to expand it.
sims/external/simics/modules/simbricks-mem/simbricks_mem_comp.py
0 → 100644
View file @
40546917
# SimBricks Memory Adapter Component
#
# Copyright (c) 2020-2023 Max Planck Institute for Software Systems
# Copyright (c) 2020-2023 National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
import
simics
from
comp
import
SimpleConfigAttribute
,
StandardComponent
class
simbricks_mem_comp
(
StandardComponent
):
"""SimBricks memory adapter component."""
def
setup
(
self
):
super
().
setup
()
if
not
self
.
instantiated
.
val
:
self
.
add_objects
()
def
add_objects
(
self
):
simbricks_mem_dev
=
self
.
add_pre_obj
(
'simbricks_mem_dev'
,
'simbricks_mem'
)
simbricks_mem_dev
.
socket
=
self
.
socket
.
val
simbricks_mem_dev
.
mem_latency
=
self
.
mem_latency
.
val
simbricks_mem_dev
.
sync_period
=
self
.
sync_period
.
val
if
self
.
cache_size
.
val
is
not
None
:
simbricks_mem_dev
.
cache_size
=
self
.
cache_size
.
val
if
self
.
cache_line_size
.
val
is
not
None
:
simbricks_mem_dev
.
cache_line_size
=
self
.
cache_line_size
.
val
class
basename
(
StandardComponent
.
basename
):
"""The default name for the created component."""
val
=
'simbricks_mem_comp'
class
socket
(
SimpleConfigAttribute
(
None
,
's'
,
simics
.
Sim_Attr_Required
)):
"""Socket Path for SimBricks messages."""
class
mem_latency
(
SimpleConfigAttribute
(
None
,
'i'
,
simics
.
Sim_Attr_Required
)
):
"""Latency in nanoseconds from host to memory."""
class
sync_period
(
SimpleConfigAttribute
(
None
,
'i'
,
simics
.
Sim_Attr_Required
)
):
"""Period for sending SimBricks synchronization messages in
nanoseconds."""
class
cache_size
(
SimpleConfigAttribute
(
None
,
'i'
,
simics
.
Sim_Attr_Optional
)
):
"""Number of cache lines."""
class
cache_line_size
(
SimpleConfigAttribute
(
None
,
'i'
,
simics
.
Sim_Attr_Optional
)
):
"""Size of each cache line in bytes."""
sims/external/simics/rules.mk
View file @
40546917
...
...
@@ -30,6 +30,9 @@ SIMICS_ISPM_DOWNLOAD ?= $(SIMICS_DIR)simics-6-packages.ispm
SIMICS_ISPM
:=
$(SIMICS_DIR)
package-manager/ispm
SIMICS_INSTALLDIR
:=
$(SIMICS_DIR)
installdir
SIMICS_INSTALL
:=
$(SIMICS_INSTALLDIR)
/simics-latest
SIMICS_BIN
:=
$(SIMICS_INSTALL)
/bin
SIMICS_MODULES
:=
$(SIMICS_DIR)
modules
SIMICS_PROJECT
:=
$(SIMICS_DIR)
project
$(SIMICS_PKGMGR_DOWNLOAD)
:
$(
error
Download intel-simics-package-manager-
(
version
)
.tar.gz from
\
...
...
@@ -54,9 +57,20 @@ $(SIMICS_INSTALL): $(SIMICS_ISPM) $(SIMICS_ISPM_DOWNLOAD)
SIMICS_LATEST
=
`
ls
-d
$(SIMICS_INSTALLDIR)
/simics-?.
*
/ |
tail
-n
1
`
;
\
ln
-sf
`
basename
$$
SIMICS_LATEST
`
$
(
@
)
$(d)ready
:
$(SIMICS_INSTALL)
$(SIMICS_PROJECT)/GNUmakefile
:
$(SIMICS_INSTALL)
mkdir
-p
$(SIMICS_PROJECT)
mkdir
-p
$(SIMICS_PROJECT)
/modules
ln
-rs
$(SIMICS_MODULES)
/
*
$(SIMICS_PROJECT)
/modules/
ln
-rs
$(SIMICS_DIR)
/.package-list
$(SIMICS_PROJECT)
/
$(SIMICS_BIN)
/project-setup
--ignore-existing-files
$(SIMICS_PROJECT)
$(d)ready
:
$(SIMICS_PROJECT)/GNUmakefile $(lib_simbricks)
$(MAKE)
-C
$(SIMICS_PROJECT)
SIMBRICKS_LIB
=
"
$(
abspath
$(lib_dir)
)
"
touch
$@
DISTCLEAN
:=
$(SIMICS_PKGMGR_DOWNLOAD)
$(SIMICS_ISPM_DOWNLOAD)
\
$(d)
package-manager
$(SIMICS_INSTALL)
$(SIMICS_INSTALLDIR)
$(d)
ready
$(d)
package-manager
$(SIMICS_INSTALL)
$(SIMICS_INSTALLDIR)
\
$(SIMICS_PROJECT)
$(d)
ready
include
mk/subdir_post.mk
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