From c207df8b0e33942bf5d5c6f63a15929123a98b6a Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Tue, 28 Mar 2017 17:25:27 +0200
Subject: [PATCH] bugfix: dlsim was not working anymore

When you ran it with the scope as:

    ./dlsim -X

you saw no activity in the "PDSCH I/Q of MF Output" window,
so matter what SNR you put (even for very high SNR, say: ./dlsim -X -s40)

this commit seems to fix it.

I am not sure it is the end of story. The 2 threads PDCCH/PDSCH structures
may still not be used correctly everywhere.
---
 openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index aa8e9360eab..5ab6007a377 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -1998,7 +1998,7 @@ int main(int argc, char **argv)
     }
   */
 
-  UE->pdcch_vars[0][0]->crnti = n_rnti;
+  UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti;
 
   // Fill in UL_alloc
   UL_alloc_pdu.type    = 0;
-- 
GitLab