scc 2026.07
SystemC components library
ihex.h
1/*******************************************************************************
2 * Copyright 2025 MINRES Technologies GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17#ifndef _UTIL_IHEX_PARSER_H_
18#define _UTIL_IHEX_PARSER_H_
19
20#include "nonstd/span.h"
21#include <cstdint>
22#include <functional>
23#include <iostream>
28namespace util {
40namespace ihex {
44enum { IHEX_DATA_SIZE = 255 };
55bool parse(std::istream&, std::function<bool(uint64_t, uint64_t, const uint8_t*)>);
56
57void dump(std::ostream&, nonstd::span<uint8_t> const&, uint32_t = 0, uint32_t = 16);
58}; // namespace ihex
59} // namespace util
60#endif
A utility class for parsing Intel Hex (IHEX) files.
Definition ihex.cpp:33
bool parse(std::istream &is, std::function< bool(uint64_t, uint64_t, const uint8_t *)> cb)
Parses an IHEX file from the given input stream and invokes a callback function for each data record ...
Definition ihex.cpp:78
SCC common utilities.
Definition bit_field.h:30