pcu: use correct RA type to properly test 2phase access

Old code was not setting Single Block Packet Access type, and 2phase
access was not properly triggered.

Once it's triggered, message flow changes quite a lot from the 1phase
access, specially because the 2nd Ul Assignment arrives through PDCH
instead of CCCH, which means a different record is received and hence
code for 1phase cannot be easily re-used.

For similar reasons, f_tx_rlcmac_ul_n_blocks() is modified to receive
the only required tfi param instead of a full dl_block.

Some functions are also extended to support SingleBlock Allocation
instead of usual DynamicAllocation.

Change-Id: If636a4898dfa175fdbd6baf04f7f2c955a9c525d
diff --git a/library/RLCMAC_CSN1_Templates.ttcn b/library/RLCMAC_CSN1_Templates.ttcn
index 07f70b4..2c1bc04 100644
--- a/library/RLCMAC_CSN1_Templates.ttcn
+++ b/library/RLCMAC_CSN1_Templates.ttcn
@@ -158,6 +158,36 @@
 				}
 			}
 		}
+	};
+
+	private function f_presence_bit_tfi(template uint5_t tfi) return BIT1 {
+		if (istemplatekind(tfi, "omit")) {
+			return '0'B;
+		}
+		return '1'B;
 	}
 
+	template PktUlAssGprs tr_PktUlAssGprsDynamic(template uint5_t tfi := ?) := {
+		ch_coding_cmd := ?,
+		tlli_block_chan_coding := ?,
+		pkt_ta := ?,
+		freq_par_present := ?,
+		freq_par := *,
+		alloc_present := '01'B,
+		dyn_block_alloc := {
+			extd_dyn_alloc := ?,
+			p0_present := ?,
+			p0 := *,
+			pr_mode := *,
+			usf_granularity := ?,
+			ul_tfi_ass_present := f_presence_bit_tfi(tfi),
+			ul_tfi_assignment := tfi,
+			reserved := '0'B,
+			tbf_starting_time_present := ?,
+			tbf_starting_time := *,
+			ts_allocation := ?
+			},
+		sgl_block_alloc := omit
+	};
+
 } with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };