winIDEA SDK
mpc5xxx_tlb_read_write.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5"""
6This script demonstrates operations on MPC5xxxController
7- reads a TLB entry
8- writes a TLB entry
9"""
10
11
12import isystem.connect as ic
13
14winidea_id = ''
15
16
17cmgr = ic.ConnectionMgr()
18cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
19
20debugCtrl = ic.CDebugFacade(cmgr)
21debugCtrl.download()
22
23# get MPC5xxx controller
24MPCCtrl = ic.CMPC5xxxController(cmgr)
25
26# get TLB 7
27TLB = MPCCtrl.getTLB(7)
28
29# change RPN to 0x40800000 physical
30TLB.m_dwMAS3 = 0x40800000 | (TLB.m_dwMAS3 & 0xFFF)
31
32# set TLB 7
33MPCCtrl.setTLB(7, TLB)
34
35