Skip to content

Commit

Permalink
Added configureation option for microslice size limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
oTTer-Chief committed Nov 22, 2016
1 parent 4d778ab commit cef74c9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/flib_cfg/flib_cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int main(int argc, char* argv[]) {
return EXIT_FAILURE;
}
flims.back()->reset_datapath();
flims.back()->set_mc_size_limit(par.mc_size_limit());
if (!flims.back()->get_pgen_present()) {
L_(fatal) << "Link " << i << ": "
<< "FLIM build does not support pgen";
Expand All @@ -72,6 +73,7 @@ int main(int argc, char* argv[]) {
return EXIT_FAILURE;
}
flims.back()->reset_datapath();
flims.back()->set_mc_size_limit(par.mc_size_limit());
if (par.link(i).source == flim) {
flims.back()->set_data_source(flib::flim::user);
} else { // pgen_far
Expand Down
4 changes: 4 additions & 0 deletions app/flib_cfg/parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class parameters {
bool identify() const { return _identify; }
uint32_t mc_size() const { return _mc_size; }
float pgen_rate() const { return _pgen_rate; }
uint32_t mc_size_limit() const { return _mc_size_limit; }

struct link_config link(size_t i) const {
return _links.at(i);
Expand Down Expand Up @@ -154,6 +155,8 @@ class parameters {
"1024 ns (31 bit wide)");
config_add("pgen-rate,r", po::value<float>(),
"MS fill level of pattern generator in [0,1]");
config_add("mc-size-limit", po::value<uint32_t>(&_mc_size_limit),
"Threshold of micsolice size limiter in bytes.");

config_add("l0_source", po::value<std::string>(),
"Link 0 data source <disable|flim|pgen_far|pgen_near>");
Expand Down Expand Up @@ -275,5 +278,6 @@ class parameters {
bool _identify = false;
uint32_t _mc_size = 10; // 10,24 us
float _pgen_rate = 1;
uint32_t _mc_size_limit = 2 ^ 20; // 1MB
std::array<struct link_config, _num_flib_links> _links = {{}};
};
9 changes: 5 additions & 4 deletions contrib/readout
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ BASE_EQID[0]=0xF00
BASE_EQID[1]=0xF01

PGEN_RATE=0.14
MC_SIZE_LIMIT=2097152

if [ "$RECORD" = true ]; then
TS_PROCESSOR="./tsclient -c%i -s%s -a --output-archive-bytes 2000000000 -o ${OUTFILE}%n.tsa"
Expand All @@ -68,7 +69,7 @@ else
fi

FLESNET_CFG=(-l 2 --timeslice-size 100 --overlap-size 1
--in-data-buffer-size-exp 27 --cn-data-buffer-size-exp 27
--cn-data-buffer-size-exp 28
--processor-instances 1)

##### configuration above this line ########
Expand Down Expand Up @@ -131,7 +132,7 @@ $ROOT_DIR/contrib/flesnet-check
echo "Configuring FLIBs ..."
for i in 0 1; do
$BINDIR/flib_cfg -c /dev/null -l 2 -L ${OUTFILE}f${i}_cfg.log -i ${ADDR[$i]} \
-t 100 -r $PGEN_RATE \
-t 100 -r $PGEN_RATE --mc-size-limit $MC_SIZE_LIMIT \
--l0_source ${LINK[0+$i*8]} --l0_eq_id ${BASE_EQID[$i]}0 \
--l1_source ${LINK[1+$i*8]} --l1_eq_id ${BASE_EQID[$i]}1 \
--l2_source ${LINK[2+$i*8]} --l2_eq_id ${BASE_EQID[$i]}2 \
Expand All @@ -146,12 +147,12 @@ done
echo "Starting flib_server ..."
if [ ${#IN_INDEX_0[@]} -ne 0 ]; then
$BINDIR/flib_server -c /dev/null -L ${OUTFILE}f0_server.log -i ${ADDR[0]} \
-o shm_server_f0 &
--data-buffer-size-exp 28 -o shm_server_f0 &
SERVER_0_PID=$!
fi
if [ ${#IN_INDEX_1[@]} -ne 0 ]; then
$BINDIR/flib_server -c /dev/null -L ${OUTFILE}f1_server.log -i ${ADDR[1]} \
-o shm_server_f1 &
--data-buffer-size-exp 28 -o shm_server_f1 &
SERVER_1_PID=$!
fi

Expand Down
5 changes: 5 additions & 0 deletions lib/flib/flim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ uint32_t flim::get_pgen_mc_pending() {
return m_rfflim->get_reg(RORC_REG_LINK_MC_PGEN_MC_PENDING);
}

void flim::set_mc_size_limit(uint32_t bytes) {
uint32_t words = bytes / 8; // sizeof(word) == 64Bit
m_rfflim->set_reg(RORC_REG_LINK_MAX_MC_WORDS, words);
}

//////*** FLIM Test and Debug ***//////

void flim::set_testreg(uint32_t data) {
Expand Down
1 change: 1 addition & 0 deletions lib/flib/flim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class flim {
void set_pgen_enable(bool enable);
void reset_pgen_mc_pending();
uint32_t get_pgen_mc_pending();
void set_mc_size_limit(uint32_t bytes);

void set_testreg(uint32_t data);
uint32_t get_testreg();
Expand Down

0 comments on commit cef74c9

Please sign in to comment.