Professional Documents
Culture Documents
OpenSPARC T1
1 Introduction 2
Bibliography 12
1
Chapter 1
Introduction
Our team was assigned to generate a working testbench for evaluation and
testing purpose of the memory cache of the OpenSPARC T1.
The OpenSPARC T1 is a completely open source processor, produced and
supported by SUN. Because of the availability of the source code, our plan was
to synthesize the core processor and perform a simulation of the cache using
special instruction sequence obtained by the use of a Sparc cross compiler; in
order to understand the correct sequence of instructions a building block scheme
of the processor was to be realized.
Unfortunately we encountered many difficulties during the development of
the plan as the task proved excessively difficult, especially the synthesis part,
which has not been fully carried out.
In this document we outline the final status of the project, the step we have
followed and the results of the operations.
2
Chapter 2
2.1 Overview
The OpenSPARC material (which comprises documentation, verilog sources and
testbenches) can be downloaded freely from the web at [1].
The processor can be synthesized in two different ways: core1 configuration
and chip8 configuation.
The core1 environment consists of:
2. Cache
3. Memory
4. Crossbar
2. Cache
3. Memory
4. Crossbar
5. I/O subsystem
3
2.2 First approach: Basic processor in Model-
sim
The first expected result consists of obtaining a complete functional version of
the processor in its basic functions; for this reason, we tried to compile and
synthesize a minimum configuration set of the processor using ModelSIM. After
creating a new project in ModelSIM and inserting all the files (both the Verilog
files and the needed libraries) inside it, we started with a syntax check on the
code, preparing for the simulation.
Unfortunately, a lot of errors appeared. We recognized some errors were due
to missing includes and so we tried to fix them; however, after overcoming the
syntax errors, we faced major problems in the simulation part.
When trying to simulate we had to cope with technological library problems
(i.e. no hardware basic blocks matched the requested) since the code was written
for synopsys, as we found out after thorough inspection.
Since we noticed that we wouldn’t have reached a complete simulation, we
decided to change the configuration environment.
#!/usr/bin/bash
export DV_ROOT="/cadtools/opensparc"
export MODEL_DIR="/cadtools/opensparc/model"
export CC_BIN="/usr/dist/pkgs/sunstudio_‘uname -p‘/SUNWspro/bin"
export SYN_HOME="/cadtools/synopsys/2002.05-SP1";
export LM_LICENSE_FILE="/import/EDAtools/licenses/synopsys_key:
/import/EDAtools/licenses/ncverilog_key";
export TRE_ENTRY="/";
export TRE_LOG="nobody";
export TRE_SEARCH="$DV_ROOT/tools/env/tools.iver";
export ENVDIR="$DV_ROOT/tools/env";
export PERL_MODULE_BASE="$DV_ROOT/tools/perlmod";
export SYN_LIB="$SYN_HOME/libraries/syn";
export SYN_BIN="$SYN_HOME/sparcOS5/syn/bin";
export PERL_VER="5.8.7";
export PERL_PATH="$DV_ROOT/tools/perl-$PERL_VER";
export PERL5_PATH="$DV_ROOT/tools/perl-$PERL_VER/lib/perl5";
export PERL_CMD="$PERL_PATH/bin/perl";
export PATH="$DV_ROOT/tools/bin:$NCV_HOME/tools/bin:$VCS_HOME/bin
:$VERA_HOME/bin:$SYN_BIN/:$CC_BIN/:$PATH";
4
The synthesis process was started by the command rsyn -all; we had to
disable the server connection timeout, since it took several hours to accomplish
the task (about 23 hours).
In the end, no error messages appeared, however, when we verified the
synthesis output, only some blocks were successfully synthesized, while others
showed some errors.
The output of the synthesis is located in the following path (of the server)
/cadtools/opensparc/design/sys/iop; it is possible to recognise the syn-
thetized modules by looking in the synoptis/gate directory which contains
the physical descritption of the path gate.
At this point we decided (together with the teacher assistant) to give up
since we had no idea how to continue the workflow.
5
Chapter 3
6
dependecies among the GCC toolchain and the libraries that need to be satisfied
before attempting any build.
Having said that, in order to obtain a working cross compiler, it is necessary
to build the following software in this order:
1. Binutils
2. Kernel headers
3. Glibc headers
4. GCC stage1
5. Glibc
6. GCC stage2
Gcc stage1 includes only the C language while stage2 comprises all the other
languages (C/C++/Java/ADA etc). For a correct configuration the compiler
used for building the cross compiler must support the -mlong-double-128 flag
(obtained by configuring GCC with --with-long-double-128).
$ export CTARGET=sparc-linux
$ export ARCH=sparc
First of all, binutils must be configured, built and installed, taking care of
removing unnecessary libraries.
$ cd /path_to_binutils_source/
$ ./configure --target=$CTARGET --prefix=/usr --with-sysroot=/usr/$CTARGET
$ make
$ make install DESTDIR=$PWD/install-root
$ rm -rf install-root/usr/{info,lib,man,share}
# cp -a install-root/* /
Then compile the kernel, even though it will result in an error, as the gcc
cross compiler isn’t ready yet, but what is really needed are the kernel headers.
$ cd /usr/src/linux
$ yes "" | make ARCH=$ARCH oldconfig prepare
# mkdir -p /usr/$CTARGET/usr/include
# cp -a include/linux include/asm-generic /usr/$CTARGET/usr/include
# cp -a include/asm-$ARCH /usr/$CTARGET/usr/include/asm
The GNU C Libraries (Glibc) suffers from the same problem as above, but
yet again only the headers are needed at this time.
7
$ cd /path_to:glibc_source/
$ mkdir build
$ cd build
$ ../configure --host=$CTARGET --prefix=/usr --with-headers= \
/usr/$CTARGET/usr/include --disable-sanity-checks
# make -k install-headers install_root=/usr/$CTARGET
# mkdir -p /usr/$CTARGET/usr/include/gnu
# touch /usr/$CTARGET/usr/include/gnu/stubs.h
# cp bits/stdio_lim.h /usr/$CTARGET/usr/include/bits/
Now it is possibile to build the core of the GCC compiler (stage1), linking
the libraries for the target architecture and removing the unnecessary ones.
cd /path_to_gcc_source/
# ln -s usr/include /usr/sparc/sys-include
$ mkdir build
$ cd build
$ ../configure --target=sparc --prefix=/usr --with-sysroot=/usr/sparc \
--enable-languages=c --disable-shared --disable-checking \
--disable-werror --disable-libmudflap --disable-libssp
$ make
$ make install DESTDIR=$PWD/install-root
$ rm -rf install-root/usr/{info,include,lib/libiberty.a,man,share}
# cp -a install-root/* /
$ rm -rf build
$ mkdir build
$ cd build
$ ../configure --host=$CTARGET --prefix=/usr
$ make
# make install install_root=/usr/$CTARGET
At this point, if no error occurred, the cross compiler can be invoked from
command line with gcc-sparc-linux.
8
The loader can be implemented with any hardware description language
like VHDL or Verilog, using a read from file function and converting data into
bus values. However this procedure requires high level of details of the final
architecture, as well as the synthezised unit under test, for some important
tuning; since neither of these were available it has been not possible to write
any memory loader.
9
Chapter 4
For the purposes of designing a test-bench for the cache memory of the OpenSPARC
T1 processor, an in-depth knowledge of its architecture and of the building
blocks it comprises is required. One of the teams in our group was in charge of
producing a block scheme of the OpenSPARC core having such a level of detail
as to permit a test design.
Our first reference was the OpenSPARC T1 Microarchitecture Specifica-
tion, available on the OpenSPARC website. It provides a good overview of the
architecture, as well as more detailed information about its implementation.
Nonetheless, the description was at times a rather high-level and qualitative
one and only scratched the surface of some components, which was usually not
enough for our goal.
As a consequence, we later decided to take a closer look at the Verilog source
code available at [4]. By means of the sidebar it is possible to navigate through
the source code. Since we were only interested in the architecture of a single
core, we started our inspection from the cmp top → OpenSPARC T1 → sparc
module within the source browser hierarchy and we progressively analysed all
the lower-level source files.
The following criterion was adopted to choose only the most meaningful
signals among the many:
• data buses were added to the block scheme if their width was relevant
(usually larger than 6 or 7 bits) or if their presence was required for some
other reason;
10
Figure 4.1: Building blocks of the OpenSPARC T1 core
11
Bibliography
12