From d16109828d57800d3ae85cdd230f1c2c8570e59c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Romain=20Bron=C3=A8s?= <romain.brones@synchrotron-soleil.fr>
Date: Wed, 13 Nov 2024 11:45:50 +0100
Subject: [PATCH] Fix and update documentation

---
 README.adoc     |  3 +++
 doc/main.adoc   | 45 +--------------------------------------------
 doc/regmap.adoc |  2 ++
 3 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/README.adoc b/README.adoc
index 43efe82..7b66d36 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1 +1,4 @@
+
+:imagesdir: doc/images
+
 include::doc/main.adoc[]
diff --git a/doc/main.adoc b/doc/main.adoc
index aef289d..f34aa59 100644
--- a/doc/main.adoc
+++ b/doc/main.adoc
@@ -41,42 +41,6 @@ _The actual __top_combpm_electron.vhd__ file provides these three blocs configur
 .Basic overview of combpm module
 image::images/overview.svg[]
 
-=== Package
-
-A package describing the AXIS packet at the module output is present.
-It helps to automatically pack or unpack the packet (functions _bpmpacket2slv()_ or _slv2bpmpacket()_ ).
-A zero packet (_C_BPMPACKET_ZERO) is also declared.
-
-.t_bpmpacket record type
-[cols="1,1,1"]
-[%autowidth]
-|===
-|Member name    | Type                          | Description
-
-|pos_x          | std_logic_vector(31 downto 0) | X position
-|pos_y          | std_logic_vector(31 downto 0) | Y position
-|bpm_id         | std_logic_vector(15 downto 0) | ID of the source BPM
-|mc_timestamp   | std_logic_vector(39 downto 0) | Timestamp at machine clock frequency
-|fa_seq         | std_logic_vector(7 downto 0)  | FA sequence number, LSB only
-|===
-
-.Some usage of pkg_bpmpacket.vhd
-[example]
-[source,vhdl]
-----
-    signal my_packet    : t_bpmpacket;
-
-(...)
-
-    my_packet  <= slv2bpmpacket(axis_tdata);  -- Convert from AXIS tdata to a BPM packet
-
-    id      <= my_packet.bpm_id;             -- Access packet fields
-    pos_x   <= my_packet.pos_x;
-
-    axis_tdata_o <= bpmpacket(my_packet); -- Convert back to logic vector for AXIS tdata
-----
-
-
 // ================================================================================
 == Details
 
@@ -89,9 +53,6 @@ A zero packet (_C_BPMPACKET_ZERO) is also declared.
 
 === BPM packet AXIS stream
 
-The AXIS data provided by the protocol decoder is descibed in the file _pkg_bpmpacket_stream.vhd_.
-See this file to have up to date fields info.
-
 * Packets are not cut into packets (TLAST always '1').
 * No FIFO on output (TREADY is not used).
 The application needs to either implement FIFO or accepts every packet (AXIS packet).
@@ -125,9 +86,5 @@ include::regmap.adoc[]
 // ================================================================================
 == TODO/Future of this module
 
-* Remove the pkg bpm stream. It is not that handy.
-* Add configuration feature to allow the choice of the transceiver (for now only X0Y4 GTH).
-* The application should be able to instanciate several transceiver interface, with one decoder for each.
-* At SOLEIL, the BPM electronics will change by 2025.
-At that point, it will be necessary to change the *Transceivers* and *Protocol decoder* blocs to match the new equipments.
+* This module will fade out of usage as SOLEIL moves to the next generation of BPM electronics
 
diff --git a/doc/regmap.adoc b/doc/regmap.adoc
index fb64a82..3b92742 100644
--- a/doc/regmap.adoc
+++ b/doc/regmap.adoc
@@ -25,12 +25,14 @@
     _FRAMEERROR_ [0:0] sw:RO uint : +++Frame error+++ +
     _SEQFRAMECNTERROR_ [1:1] sw:RO uint : +++Sequence frame count mismatch+++ +
     _SEQFRAMEDISCONT_ [2:2] sw:RO uint : +++Sequence frame discontinuity+++ +
+| RESET_ERROR                              |    1 |    1 |     uint | RW | +++None+++ +
 | RESET                                    |    1 |    1 |     uint | RW | +++None+++ +
 | VALIDFRAMECNT                            |    1 |   32 |     uint | RO | +++BPM protocol valid frame counters+++ +
 | INVALIDFRAMECNT                          |    1 |   32 |     uint | RO | +++BPM protocol invalid frame counters+++ +
 | VALIDFRAMERATE                           |    1 |   32 |     uint | RO | +++BPM protocol valid frame rate+++ +
 | INVALIDFRAMERATE                         |    1 |   32 |     uint | RO | +++BPM protocol invalid frame rate+++ +
 | FRAMESEQ                                 |    1 |   16 |     uint | RO | +++BPM protocol frame sequence+++ +
+| SEQ_OFFSET                               |    1 |   16 |    int16 | RW | +++Sequence numbering offset+++ +
 | FILTERTABLE                              |  256 |   32 | uint | RW | +++BPM filter table+++ +
 |=== 
 
-- 
GitLab