From 8f5133d8111d83137195b8cdae5d80747f8ee315 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 11 Feb 2021 13:46:29 +0000 Subject: machxo2: Use snake_case for non-ArchAPI functions Signed-off-by: gatecat --- machxo2/arch.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'machxo2/arch.cc') diff --git a/machxo2/arch.cc b/machxo2/arch.cc index c2b2e0ad..21129f07 100644 --- a/machxo2/arch.cc +++ b/machxo2/arch.cc @@ -109,7 +109,7 @@ Arch::Arch(ArchArgs args) : args(args) } } -bool Arch::isAvailable(ArchArgs::ArchArgsTypes chip) { return get_chip_info(chip) != nullptr; } +bool Arch::is_available(ArchArgs::ArchArgsTypes chip) { return get_chip_info(chip) != nullptr; } std::string Arch::getChipName() const { @@ -130,7 +130,7 @@ std::string Arch::getChipName() const } } -std::string Arch::getFullChipName() const +std::string Arch::get_full_chip_name() const { std::string name = getChipName(); name += "-"; @@ -187,7 +187,7 @@ BelId Arch::getBelByName(IdStringList name) const loc.x = id_to_x.at(name[0]); loc.y = id_to_y.at(name[1]); ret.location = loc; - const TileTypePOD *loci = tileInfo(ret); + const TileTypePOD *loci = tile_info(ret); for (int i = 0; i < loci->num_bels; i++) { if (std::strcmp(loci->bel_data[i].name.get(), name[2].c_str(this)) == 0) { ret.index = i; @@ -207,7 +207,7 @@ BelId Arch::getBelByLocation(Loc loc) const ret.location.x = loc.x; ret.location.y = loc.y; - const TileTypePOD *tilei = tileInfo(ret); + const TileTypePOD *tilei = tile_info(ret); for (int i = 0; i < tilei->num_bels; i++) { if (tilei->bel_data[i].z == loc.z) { ret.index = i; @@ -241,8 +241,8 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const { NPNR_ASSERT(bel != BelId()); - int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires; - const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires; + int num_bel_wires = tile_info(bel)->bel_data[bel.index].num_bel_wires; + const BelWirePOD *bel_wires = &*tile_info(bel)->bel_data[bel.index].bel_wires; for (int i = 0; i < num_bel_wires; i++) if (bel_wires[i].port == pin.index) { @@ -262,8 +262,8 @@ PortType Arch::getBelPinType(BelId bel, IdString pin) const { NPNR_ASSERT(bel != BelId()); - int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires; - const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires; + int num_bel_wires = tile_info(bel)->bel_data[bel.index].num_bel_wires; + const BelWirePOD *bel_wires = &*tile_info(bel)->bel_data[bel.index].bel_wires; for (int i = 0; i < num_bel_wires; i++) if (bel_wires[i].port == pin.index) @@ -277,8 +277,8 @@ std::vector Arch::getBelPins(BelId bel) const std::vector ret; NPNR_ASSERT(bel != BelId()); - int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires; - const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires; + int num_bel_wires = tile_info(bel)->bel_data[bel.index].num_bel_wires; + const BelWirePOD *bel_wires = &*tile_info(bel)->bel_data[bel.index].bel_wires; for (int i = 0; i < num_bel_wires; i++) { IdString id(bel_wires[i].port); @@ -314,7 +314,7 @@ WireId Arch::getWireByName(IdStringList name) const loc.x = id_to_x.at(name[0]); loc.y = id_to_y.at(name[1]); ret.location = loc; - const TileTypePOD *loci = tileInfo(ret); + const TileTypePOD *loci = tile_info(ret); for (int i = 0; i < loci->num_wires; i++) { if (std::strcmp(loci->wire_data[i].name.get(), name[2].c_str(this)) == 0) { ret.index = i; @@ -340,7 +340,7 @@ PipId Arch::getPipByName(IdStringList name) const loc.x = id_to_x.at(name[0]); loc.y = id_to_y.at(name[1]); ret.location = loc; - const TileTypePOD *loci = tileInfo(ret); + const TileTypePOD *loci = tile_info(ret); for (int i = 0; i < loci->num_pips; i++) { PipId curr; curr.location = loc; @@ -354,10 +354,10 @@ PipId Arch::getPipByName(IdStringList name) const IdStringList Arch::getPipName(PipId pip) const { - auto &pip_data = tileInfo(pip)->pips_data[pip.index]; + auto &pip_data = tile_info(pip)->pips_data[pip.index]; WireId src = getPipSrcWire(pip), dst = getPipDstWire(pip); - const char *src_name = tileInfo(src)->wire_data[src.index].name.get(); - const char *dst_name = tileInfo(dst)->wire_data[dst.index].name.get(); + const char *src_name = tile_info(src)->wire_data[src.index].name.get(); + const char *dst_name = tile_info(dst)->wire_data[dst.index].name.get(); std::string pip_name = stringf("%d_%d_%s->%d_%d_%s", pip_data.src.x - pip.location.x, pip_data.src.y - pip.location.y, src_name, pip_data.dst.x - pip.location.x, pip_data.dst.y - pip.location.y, dst_name); @@ -465,9 +465,9 @@ const std::vector Arch::availablePlacers = {"sa", const std::string Arch::defaultRouter = "router1"; const std::vector Arch::availableRouters = {"router1", "router2"}; -bool Arch::cellsCompatible(const CellInfo **cells, int count) const { return false; } +bool Arch::cells_compatible(const CellInfo **cells, int count) const { return false; } -std::vector> Arch::getTilesAtLocation(int row, int col) +std::vector> Arch::get_tiles_at_location(int row, int col) { std::vector> ret; auto &tileloc = chip_info->tile_info[row * chip_info->width + col]; -- cgit v1.2.3