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
c3e90009
Commit
c3e90009
authored
Oct 25, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd: add loopbacks.
parent
73dcea14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
103 deletions
+0
-103
loop-queue.c
software/firmware/common/loop-queue.c
+0
-67
loop-queue.h
software/firmware/common/loop-queue.h
+0
-36
No files found.
software/firmware/common/loop-queue.c
deleted
100644 → 0
View file @
73dcea14
/*
* Shared Memory-based Loopback queue for internal trigger distribution
*
* Copyright (C) 2013-2014 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mockturtle-rt.h"
#include "wrtd-common.h"
#define LOOP_QUEUE_SIZE 16
static
SMEM
int
head
,
tail
,
count
;
static
SMEM
struct
wrtd_trigger_entry
buf
[
16
];
void
loop_queue_init
()
{
head
=
0
;
tail
=
0
;
count
=
0
;
}
void
loop_queue_push
(
struct
wrtd_trig_id
*
id
,
uint32_t
seq
,
struct
wr_timestamp
*
ts
)
{
if
(
count
>=
LOOP_QUEUE_SIZE
)
return
;
buf
[
head
].
id
=
*
id
;
buf
[
head
].
seq
=
seq
;
buf
[
head
].
ts
=
*
ts
;
smem_atomic_add
(
&
head
,
1
);
if
(
head
>=
LOOP_QUEUE_SIZE
)
head
=
0
;
smem_atomic_add
(
&
count
,
1
);
}
volatile
struct
wrtd_trigger_entry
*
loop_queue_pop
(
void
)
{
volatile
struct
wrtd_trigger_entry
*
rv
;
if
(
count
==
0
)
return
NULL
;
/* No entry */
rv
=
&
buf
[
tail
];
smem_atomic_add
(
&
tail
,
1
);
if
(
tail
>=
LOOP_QUEUE_SIZE
)
tail
=
0
;
smem_atomic_sub
(
&
count
,
1
);
return
rv
;
}
software/firmware/common/loop-queue.h
deleted
100644 → 0
View file @
73dcea14
/*
* Shared Memory-based Loopback queue for internal trigger distribution
*
* Copyright (C) 2013-2014 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LOOP_QUEUE_H
#define __LOOP_QUEUE_H
#include "mockturtle-rt.h"
#include "wrtd-common.h"
#define LOOP_QUEUE_SIZE 16
void
loop_queue_init
();
void
loop_queue_push
(
struct
wrtd_trig_id
*
id
,
uint32_t
seq
,
struct
wr_timestamp
*
ts
);
volatile
struct
wrtd_trigger_entry
*
loop_queue_pop
(
void
);
#endif
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