libpynq (release 5EWC0-2023 version 0.2.6 of 2023-10-24 17:28)
Loading...
Searching...
No Matches
version.c
Go to the documentation of this file.
1/*
2Copyright (c) 2023 Eindhoven University of Technology
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22#include <libpynq.h>
23
24/**********************
25 * WARNING
26 * only change the numbers in these 4 #defs; do not change anything else
27 * the libpynq version in doxygen ryb.doxy is updated automatically based
28 * on the next 4 lines
29 **********************/
30#define LIBPYNQ_RELEASE "5EWC0-2023"
31#define LIBPYNQ_VERSION_MAJOR 0
32#define LIBPYNQ_VERSION_MINOR 2
33#define LIBPYNQ_VERSION_PATCH 6
40
41#undef LOG_DOMAIN
42#define LOG_DOMAIN "version"
43
44void print_version(void) {
45 arm_shared t;
46 version_t volatile *hardwareVersion =
47 (version_t volatile *)arm_shared_init(&t, axi_version_0, 4096);
48 printf("Bitstream version: %d.%d.%d\r\n", hardwareVersion->major,
49 hardwareVersion->minor, hardwareVersion->patch);
50 printf("Libpynq release %s version %d.%d.%d\r\n", libpynq_version.release,
52 if (libpynq_version.major != hardwareVersion->major) {
54 "ERROR: the bitstream (hardware) and the libpynq library versions "
55 "are incompatible. Please update your SD-card image and libpynq "
56 "library.\n");
57 } else if (libpynq_version.minor > hardwareVersion->minor) {
58 printf("INFO: the libpynq library is newer than the bitstream (hardware). "
59 "Please check if there is a newer version of the SD-card image.\n");
60 } else if (libpynq_version.minor < hardwareVersion->minor) {
61 printf(
62 "INFO: the bitstream (hardware) is newer than the libpynq library. "
63 "Please check if there is a newer version of the libpynq library.\n");
64 }
66}
67
68void check_version(void) {
69 arm_shared t;
70 version_t volatile *hardwareVersion =
71 (version_t volatile *)arm_shared_init(&t, axi_version_0, 4096);
72 if (libpynq_version.major != hardwareVersion->major) {
74 }
76}
void arm_shared_close(arm_shared *handle)
void * arm_shared_init(arm_shared *handle, const uint32_t address, const uint32_t length)
#define pynq_error(...)
Definition log.h:118
void check_version(void)
Definition version.c:68
void print_version(void)
Definition version.c:44
const version_t libpynq_version
Definition version.c:34
uint8_t release[64]
Definition version.h:64
uint32_t patch
Definition version.h:67
uint32_t major
Definition version.h:65
uint32_t minor
Definition version.h:66
#define LIBPYNQ_RELEASE
Definition version.c:30
#define LIBPYNQ_VERSION_MAJOR
Definition version.c:31
#define LIBPYNQ_VERSION_MINOR
Definition version.c:32
#define LIBPYNQ_VERSION_PATCH
Definition version.c:33