# Tofino P4 Programming

**URL:** <https://forum.p4.org/t/tofino-p4-programming/981>\
**Category:** Uncategorized\
**Created:** [October 7, 2023, 11:30am UTC](https://forum.p4.org/t/tofino-p4-programming/981 "2023-10-07T11:30:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jianyu](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jianyu](https://forum.p4.org/u/Jianyu)\
**Post date:** [October 7, 2023, 11:30am UTC](https://forum.p4.org/t/tofino-p4-programming/981/1 "2023-10-07T11:30:03Z")

</div>

How to use tofino p4 program to read and write registers. For example, I want to store the first five packet sizes of the same stream in a register and read these values through the control plane (python). How can I write this program?

---

<div class="post-metadata">

**Author:** ![p4prof](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/p4prof/32/251_2.png) [@p4prof](https://forum.p4.org/u/p4prof)\
**Post date:** [October 8, 2023, 6:28pm UTC](https://forum.p4.org/t/tofino-p4-programming/981/2 "2023-10-08T18:28:09Z")

</div>

@Jianyu,

You can find a lot of useful information on this forum, **especially** if you use its search function ( 🔍). For example, [a simple search on the “tofino” keyword](https://forum.p4.org/search?q=tofino) will immediately produce [this post](https://forum.p4.org/t/tofino-tna-and-p4studio-questions/504), which contains the necessary recommendations.

Also, if you you haven’t done it already, I’d highly recommend you attend [Intel Connectivity Academy by P4ica](https://p4ica.eventbrite.com/#events) courses.

Happy hacking,  
Vladimir
