Commit 8d898988 authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Rubini

arch-sim: initial commit with directory tree

Kconfig is updated with new arch.
It compiles but it's actually doing nothing
parent 899ab83e
...@@ -44,9 +44,18 @@ config ARCH_WRS ...@@ -44,9 +44,18 @@ config ARCH_WRS
help help
Build PPSi for use in the WR switch. The computer is a standard Build PPSi for use in the WR switch. The computer is a standard
ARM-Linux host with hardware timestamping and internal PLLs ARM-Linux host with hardware timestamping and internal PLLs
needed to achieve sub-ns synchnonization. needed to achieve sub-ns synchronization.
The configuration selects the "White Rabbit" protocol extension. The configuration selects the "White Rabbit" protocol extension.
config ARCH_SIMULATOR
bool "PPSi Simulator (hosted on Linux)"
help
Build a PPSi simulator. It's almost a unix full running slave,
with a simulated master stimulating it for test purposes. This
avoids to wait a long time to see how PPSi behaves.
This architecture uses standard Unix system calls, but the
code includes some Linux dependencies.
endchoice endchoice
config ARCH config ARCH
...@@ -56,6 +65,7 @@ config ARCH ...@@ -56,6 +65,7 @@ config ARCH
default "bare-x86-64" if ARCH_BARE_X86_64 default "bare-x86-64" if ARCH_BARE_X86_64
default "wrpc" if ARCH_WRPC default "wrpc" if ARCH_WRPC
default "wrs" if ARCH_WRS default "wrs" if ARCH_WRS
default "sim" if ARCH_SIMULATOR
......
# All files are under A (short for ARCH): I'm lazy
A := arch-$(ARCH)
CFLAGS += -Itools
OBJ-y += $A/sim-startup.o \
$A/main-loop.o \
$A/sim-io.o \
lib/div64.o
# lib/dump-funcs.o \
# lib/conf.o \
# lib/libc-functions.o \
# lib/cmdline.o \
# Support only "sim" time operations
TIME := sim
include time-$(TIME)/Makefile
all: $(TARGET)
# to build the target, we need -lstd again, in case we call functions that
# were not selected yet (e.g., pp_open_globals() ).
$(TARGET): $(TARGET).o
$(CC) -Wl,-Map,$(TARGET).map2 -o $@ $(TARGET).o -lrt
#ifndef __ARCH_H__
#define __ARCH_H__
/* Architecture-specific defines, included by top-level stuff */
#include <arpa/inet.h> /* ntohs etc */
#include <stdlib.h> /* abs */
#endif /* __ARCH_H__ */
#ifndef __PPSI_ARCH_CONSTANTS_H__
#define __PPSI_ARCH_CONSTANTS_H__
#ifndef __PPSI_CONSTANTS_H__
#Warning "Please include <ppsi/constants.h> before <arch/constants.h>"
#endif
/* nothing to do here, we keep project-wide defaults */
#endif /* __PPSI_ARCH_CONSTANTS_H__ */
/*
* Author: Pietro Fezzardi (pietrofezzardi@gmail.com)
*
* Released to the public domain
*/
/*
* These are the functions provided by the various sim files
*/
/* the arch_data is the same as unix */
#define POSIX_ARCH(ppg) ((struct unix_arch_data *)(ppg->arch_data))
struct unix_arch_data {
struct timeval tv;
};
extern void sim_main_loop(struct pp_globals *ppg);
/*
* Copyright (C) 2011 CERN (www.cern.ch)
* Author: Alessandro Rubini
*
* Released to the public domain
*/
#include <stdio.h>
#include <ppsi/ppsi.h>
void pp_puts(const char *s)
{
fputs(s, stdout);
}
#include <ppsi/ppsi.h>
#include "ppsi-sim.h"
int main(int argc, char **argv)
{
return 0;
}
# This Makefile in included by architectures that select time-sim
# as a default, or by builds with explicit TIME=sim.
# Object files are added straight, as they are always needed
OBJ-y += time-sim/sim-time.o time-sim/sim-socket.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment