mirror of https://github.com/openXC7/prjxray.git
lib: xc7series: ostream operator for ConfigurationFrameAddress
Writes a decoded version of the address to the stream. Handy for logging. Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
This commit is contained in:
parent
a4858be23a
commit
0d2c33bf0f
|
|
@ -2,6 +2,7 @@
|
|||
#define PRJXRAY_LIB_XILINX_XC7SERIES_CONFIGURATION_FRAME_ADDRESS_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
|
||||
#include <prjxray/xilinx/xc7series/block_type.h>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
|
@ -34,6 +35,9 @@ class ConfigurationFrameAddress {
|
|||
uint32_t address_;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(
|
||||
std::ostream &o, const ConfigurationFrameAddress& addr);
|
||||
|
||||
} // namespace xc7series
|
||||
} // namespace xilinx
|
||||
} // namespace prjxray
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include <prjxray/xilinx/xc7series/configuration_frame_address.h>
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
#include <prjxray/bit_ops.h>
|
||||
|
||||
namespace prjxray {
|
||||
|
|
@ -37,6 +39,27 @@ uint8_t ConfigurationFrameAddress::minor_address() const {
|
|||
return bit_field_get(address_, 6, 0);
|
||||
}
|
||||
|
||||
std::ostream &operator<<(
|
||||
std::ostream &o, const ConfigurationFrameAddress& addr) {
|
||||
o << "["
|
||||
<< std::hex << std::showbase << std::setw(10)
|
||||
<< static_cast<uint32_t>(addr)
|
||||
<< "] "
|
||||
<< (addr.is_bottom_half_rows() ? "BOTTOM" : "TOP")
|
||||
<< " Row="
|
||||
<< std::setw(2) << std::dec
|
||||
<< static_cast<unsigned int>(addr.row_address())
|
||||
<< " Column="
|
||||
<< std::setw(2) << std::dec
|
||||
<< addr.column_address()
|
||||
<< " Minor="
|
||||
<< std::setw(2) << std::dec
|
||||
<< static_cast<unsigned int>(addr.minor_address())
|
||||
<< " Type="
|
||||
<< addr.block_type();
|
||||
return o;
|
||||
}
|
||||
|
||||
} // namespace xc7series
|
||||
} // namespace xilinx
|
||||
} // namespace prjxray
|
||||
|
|
|
|||
Loading…
Reference in New Issue