Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Trigger Distribution
Commits
d4437b33
Commit
d4437b33
authored
Feb 18, 2021
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: add tdc-x2 firmware
parent
b7f93839
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
0 deletions
+162
-0
Kconfig
software/firmware/tdc-x2/Kconfig
+6
-0
Makefile
software/firmware/tdc-x2/Makefile
+20
-0
TBuild
software/firmware/tdc-x2/TBuild
+2
-0
mt_defconfig
software/firmware/tdc-x2/configs/mt_defconfig
+33
-0
trtl-memory.ld
software/firmware/tdc-x2/trtl-memory.ld
+1
-0
wrtd-rt-tdc-x2.c
software/firmware/tdc-x2/wrtd-rt-tdc-x2.c
+100
-0
No files found.
software/firmware/tdc-x2/Kconfig
0 → 100644
View file @
d4437b33
mainmenu "WRTD TDC firmware configuration"
comment "Project specific configuration"
# include Mock Turtle's Kconfig
source "Kconfig.mt"
software/firmware/tdc-x2/Makefile
0 → 100644
View file @
d4437b33
-include
Makefile.specific
CUR_DIR
:=
$(
shell
pwd
)
FETCHTO
=
$(CUR_DIR)
/../../../dependencies
WRTD_DEP_TRTL
?=
$(FETCHTO)
/mock-turtle
WRTD_DEP_TRTL_SW
?=
$(WRTD_DEP_TRTL)
/software
WRTD_DEP_TRTL_FW
?=
$(WRTD_DEP_TRTL_SW)
/firmware
WRTD_DEP_GEN_CORES
?=
$(FETCHTO)
/general-cores
EXTRA2_CFLAGS
+=
# To be set by user on make line
EXTRA_CFLAGS
+=
$(EXTRA2_CFLAGS)
EXTRA_CFLAGS
+=
-I
$(CUR_DIR)
/../../include
-I
$(CUR_DIR)
/../common
-I
$(CUR_DIR)
/../tdc
# Redirect all rules to MockTurtle
%
:
$(MAKE)
-C
$(WRTD_DEP_TRTL_FW)
M
=
$(CUR_DIR)
\
GEN_CORES
=
$(WRTD_DEP_GEN_CORES)
EXTRA_CFLAGS
=
"
$(EXTRA_CFLAGS)
"
$@
software/firmware/tdc-x2/TBuild
0 → 100644
View file @
d4437b33
OBJS := wrtd-rt-tdc-x2.o
OUTPUT = wrtd-rt-tdc-x2
software/firmware/tdc-x2/configs/mt_defconfig
0 → 100644
View file @
d4437b33
#
# Automatically generated file; DO NOT EDIT.
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
CONFIG_FPGA_APPLICATION_ID=0
CONFIG_RT_APPLICATION_ID=0
CONFIG_CFLAGS_OPT="-Os"
CONFIG_CFLAGS_EXTRA="-ggdb"
#
# Mock Turtle framework configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_ACTION_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_PING_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VERSION_ENABLE=y
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_MESSAGE_ENABLE is not set
software/firmware/tdc-x2/trtl-memory.ld
0 → 120000
View file @
d4437b33
../common/trtl-memory.ld
\ No newline at end of file
software/firmware/tdc-x2/wrtd-rt-tdc-x2.c
0 → 100644
View file @
d4437b33
/**
* @file wrtd-rt-tdc.c
*
* Copyright (c) 2018-2019 CERN (home.cern)
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "mockturtle-rt.h"
#include <mockturtle-framework.h>
#include "wrtd-common.h"
#include "hw/fmctdc-direct.h"
#define NBR_CPUS 1
#define CPU_IDX 0
#define NBR_RULES 16
#define NBR_DEVICES 2
#define NBR_ALARMS 0
#define DEVICES_NBR_CHS { 5, 5, 0, 0}
#define DEVICES_CHS_DIR { WRTD_CH_DIR_IN, WRTD_CH_DIR_IN, 0, 0}
#define APP_ID 0x35D2
#define APP_VER RT_VERSION(2, 0)
#define APP_NAME "wrtd-tdc-x2"
#define WRTD_NET_TX 1
#define WRTD_NET_RX 0
#define WRTD_LOCAL_TX 0
#define WRTD_LOCAL_RX 1
#include "wrtd-rt-common.h"
#include "wrtd-tdc.c"
static
struct
wrtd_tdc_dev
tdc0
=
{
.
io_addr
=
0x0
,
.
ch
=
0
,
};
static
struct
wrtd_tdc_dev
tdc1
=
{
.
io_addr
=
0x10000
,
.
ch
=
5
,
};
static
inline
int
wr_link_up
(
void
)
{
// Same value for tdc0 and tdc1.
return
tdc_wr_link_up
(
&
tdc0
);
}
static
inline
int
wr_time_locked
(
void
)
{
// Same value for tdc0 and tdc1.
return
tdc_wr_time_locked
(
&
tdc0
);
}
static
inline
int
wr_time_ready
(
void
)
{
// Same value for tdc0 and tdc1.
return
tdc_wr_time_ready
(
&
tdc0
);
}
static
inline
void
wr_enable_lock
(
int
enable
)
{
tdc_wr_enable_lock
(
&
tdc0
,
enable
);
tdc_wr_enable_lock
(
&
tdc1
,
enable
);
}
static
inline
int
wr_sync_timeout
(
void
)
{
#ifdef SIMULATION
return
0
;
#else
return
tdc_wr_sync_timeout
();
#endif
}
static
int
wrtd_local_output
(
struct
wrtd_event
*
ev
,
unsigned
ch
)
{
/* No output. */
return
0
;
}
static
int
wrtd_user_init
(
void
)
{
tdc_init
(
&
tdc0
);
tdc_init
(
&
tdc1
);
wr_enable_lock
(
0
);
pr_debug
(
"rt-tdc firmware initialized.
\n\r
"
);
return
0
;
}
static
void
wrtd_io
(
void
)
{
tdc_input
(
&
tdc0
);
tdc_input
(
&
tdc1
);
}
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