1 #ifndef CARMA_SWITCHYARD_SIGNALPATHMAP_H
2 #define CARMA_SWITCHYARD_SIGNALPATHMAP_H
15 #include "carma/util/CorrelatorType.h"
25 namespace signalpath {
31 class AstroBandConfiguration;
36 class BlockDownconverter;
37 class BlockDownconverterInput;
41 class CorrelatorCrate;
42 class CorrelatorCrateInput;
45 class CorrelatorBandInput;
51 class SwitchyardConfiguration;
62 enum ConfigurationType {
68 CONF_FULLSTOKES = 0x10,
77 CORR_NONE = carma::util::CORR_NONE,
78 CORR_SL = carma::util::CORR_SPECTRAL,
79 CORR_WB = carma::util::CORR_WIDEBAND,
80 CORR_C3GMAX8 = carma::util::CORR_C3GMAX8,
81 CORR_C3GMAX23 = carma::util::CORR_C3GMAX23,
82 CORR_C3G = CORR_C3GMAX8 | CORR_C3GMAX23,
83 CORR_ALL = carma::util::CORR_ALL
86 std::ostream& operator<<(std::ostream& os,
const CorrelatorType& type);
92 enum BlockDownconverterInputType {
98 std::ostream& operator<<(std::ostream& os,
const BlockDownconverterInputType& type);
111 std::ostream& operator<<(std::ostream& os,
const AntennaType& type);
117 enum PolarizationType {
121 POL_ANY = POL_LEFT | POL_RIGHT
124 std::ostream& operator<<(std::ostream& os,
const PolarizationType& type);
130 enum SplitterChannelId {
138 std::ostream& operator<<(std::ostream& os,
const SplitterChannelId&
id);
151 SA_OFFLINE = SA_NONE,
157 SA_ANY = SA_1 | SA_2 | SA_3 | SA_4
164 enum SwitchChannelId {
172 std::ostream& operator<<(std::ostream& os,
const SwitchChannelId&
id);
181 unsigned walshColNo_;
182 SubarrayId subarrayId_;
185 struct AntennaIFSpec {
187 PolarizationType polType_;
190 struct CorrelatorCrateSpec {
195 struct CorrelatorCrateInputSpec {
196 CorrelatorCrateSpec crate_;
198 AntennaIFSpec antIF_;
201 struct CorrelatorBandSpec {
202 CorrelatorCrateSpec crate_;
206 struct AstroBandInputSpec {
207 unsigned astroBandNo_;
211 struct CorrelatorBandInputSpec {
212 CorrelatorBandSpec band_;
214 AntennaIFSpec antIF_;
215 AstroBandInputSpec astroBandInput_;
236 friend std::ostream& operator<<(std::ostream& os,
const ConnectableNode& node);
249 unsigned astroBandNo_;
251 virtual bool canBeConfiguredBy(AstroBandInfo* info);
252 virtual bool canBeConfiguredBy(
unsigned astroBandNo);
257 unsigned getCurrentAstroBandNo();
261 virtual void setOwnershipTo(AstroBandInfo* info);
262 virtual void setOwnershipTo(
unsigned astroBandNo);
264 virtual void removeFromOwnership(AstroBandInfo* info);
265 virtual void removeFromOwnership(
unsigned astroBandNo);
267 virtual bool belongsTo(AstroBandInfo* info);
268 virtual bool isOwnedByNoone();
269 virtual bool requestorMatches(AstroBandInfo* info);
270 virtual bool requestorOwnsAll(AstroBandInfo* info);
289 sza::util::BitMask astroBandMask_;
291 virtual void setOwnershipTo(AstroBandInfo* info);
292 virtual void setOwnershipTo(
unsigned astroBandNo);
294 virtual void removeFromOwnership(AstroBandInfo* info);
295 virtual void removeFromOwnership(
unsigned astroBandNo);
297 virtual bool isOwnedByNoone();
299 virtual bool isSoleOwner(AstroBandInfo* info);
300 virtual bool isSoleOwner(
unsigned astroBandNo);
302 virtual bool belongsTo(AstroBandInfo* info);
303 virtual bool belongsTo(
unsigned astroBandNo);
305 virtual bool requestorMatches(AstroBandInfo* info);
306 virtual bool requestorMatches(
unsigned astroBandNo);
308 virtual bool requestorOwnsAll(AstroBandInfo* info);
309 virtual bool requestorOwnsAll(
unsigned astroBandNo);
311 virtual bool canBeConfiguredBy(AstroBandInfo* info);
312 virtual bool canBeConfiguredBy(
unsigned astroBandNo);
314 std::string listOwners();
330 PolarizationType polType_;
334 SplitterChannelId splitterChannel_;
338 AntennaIF(Antenna* antenna, PolarizationType polType, SplitterChannelId splitterChannel);
339 virtual ~AntennaIF();
341 void validateAntenna();
342 Antenna* getAntenna();
346 bool isUsedByConfiguredAstroBand();
350 std::string printDown();
351 std::string printUp();
353 friend std::ostream& operator<<(std::ostream& os,
const AntennaIF& antIf);
361 class SwitchChannel :
public ConnectableNode {
370 SwitchChannelId channelId_;
378 SwitchChannel(Switch* sw, SwitchChannelId channelId);
379 virtual ~SwitchChannel();
381 void validateAntennaIF();
382 AntennaIF* getAntennaIF();
386 std::string printDown();
387 std::string printUp();
389 friend std::ostream& operator<<(std::ostream& os,
const SwitchChannel& swChan);
402 class Switch :
public ConfigurableDeviceMultiAstroBand,
public ConnectableNode {
415 std::map<SwitchChannelId, SwitchChannel*> channelMap_;
419 SwitchChannel* currentChannel_;
423 BlockDownconverterInput* bdcInput_;
427 Switch(
unsigned id, std::string name);
428 Switch(
const Switch& sw);
433 void operator=(
const Switch& sw);
434 void operator=(Switch& sw);
436 void initialize(
unsigned id, std::string name);
437 void initializeChannelMap();
438 void clearChannelMap();
439 void clearSwitchSetting();
440 bool isUsedByConfiguredAstroBand();
442 void validateBdcInput();
443 BlockDownconverterInput* getBdcInput();
445 void validateCurrentChannel();
446 SwitchChannel* getCurrentChannel();
450 void validateChannel(SwitchChannelId chanId);
454 void selectChannel(SwitchChannelId chanId);
456 bool canBeConfiguredBy(AstroBandInfo* info, SwitchChannel* channel);
462 std::string printDown();
464 friend std::ostream& operator<<(std::ostream& os,
const Switch& sw);
474 unsigned walshColNo_;
480 std::map<CorrelatorType, unsigned> corrWalshColMap_;
482 static const unsigned nWalshCol_;
487 void validateWalshColNo(
unsigned walshColNo);
488 void setWalshColNo(
unsigned walshColNo,
bool override=
false);
489 unsigned getWalshColNo();
490 void setHardwired(
bool hardwired);
502 bool operator==(WalshColumn& wf);
503 bool operator!=(WalshColumn& wf);
504 void operator=(WalshColumn& wf);
506 friend std::ostream& operator<<(std::ostream& os,
const WalshColumn& wc);
518 bool requestToRelease(SubarrayId subarrayId_);
519 void requestToControl(SubarrayId subarrayId_);
522 SubarrayId subarrayId_;
524 std::vector<Correlator*> exclusiveCorrelators_;
549 std::vector<CorrelatorCrateInput*> inputs_;
555 CorrelatorCrateInput* getInput(
unsigned inputNo);
556 void validateInput(
unsigned inputNo);
558 static const unsigned nInput_;
559 static const unsigned nCrateSl_;
560 static const unsigned nCrateWb_;
561 static const unsigned nInputPerBandWb_;
562 static const unsigned nInputPerBandSl_;
587 WalshColumn walshCol_;
597 CorrelatorBandInput* corrBandInput_;
605 void validateBdcBand();
609 CorrelatorBandInput* getCorrelatorBandInput();
610 void validateCorrelatorBandInput();
614 AstroBandInput* getAstroBandInput();
615 void validateAstroBandInput();
616 bool isConnectedToAstroBand();
618 void mapTo(CorrelatorBandInput* input);
621 ~CorrelatorCrateInput();
623 bool isUsedByConfiguredAstroBand();
638 class Band :
public ConfigurableDevice {
647 BlockDownconverter* bdc_;
651 CorrelatorCrateInput* corrInput_;
656 BlockDownconverterInput* bdcInput_;
658 Band(BlockDownconverter* parent,
unsigned bandNo);
662 void mapBdcInput(BlockDownconverterInput* input);
664 bool isUsedByConfiguredAstroBand();
667 std::string printUp();
672 BlockDownconverter* getBdc();
674 void validateBdcInput();
675 BlockDownconverterInput* getBdcInput();
677 void validateCorrelatorCrateInput();
678 CorrelatorCrateInput* getCorrelatorCrateInput();
685 class BlockDownconverterInput {
690 BlockDownconverter* bdc_;
694 BlockDownconverterInputType type_;
704 std::vector<Band*> bands_;
708 BlockDownconverterInput(BlockDownconverter* bdc, BlockDownconverterInputType type);
716 void addBand(Band* band);
720 void removeBand(Band* band);
722 void validateSwitch();
726 BlockDownconverter* getBdc();
728 bool isUsedByConfiguredAstroBand();
732 std::string printDown(std::ostringstream& ios,
bool printBands);
733 std::string printUp();
735 friend std::ostream& operator<<(std::ostream& os,
const BlockDownconverterInput& bdcInput);
742 class BlockDownconverter {
747 static const unsigned nBandSl_;
748 static const unsigned nBandWb_;
749 static const unsigned nBandC3g_;
761 std::map<BlockDownconverterInputType, BlockDownconverterInput*> inputMap_;
765 std::vector<Band*> bands_;
770 BlockDownconverter(
const BlockDownconverter& ant);
771 BlockDownconverter(BlockDownconverter& ant);
775 virtual ~BlockDownconverter();
779 void operator=(
const BlockDownconverter& ant);
780 void operator=(BlockDownconverter& ant);
787 BlockDownconverterInput* getInput(BlockDownconverterInputType type);
788 void validateInput(BlockDownconverterInputType type);
794 Band* getBand(
unsigned bandNo);
795 void validateBand(
unsigned bandNo);
797 std::string printUp();
799 std::string printBandVec(std::vector<Band*>& bands);
801 friend std::ostream& operator<<(std::ostream& os,
const BlockDownconverter& corr);
808 class CorrelatorBand :
public ConnectableNode {
813 static const unsigned nBandMax_;
817 static const unsigned nInputSl_;
818 static const unsigned nInputWb_;
819 static const unsigned nInputC3g_;
823 CorrelatorCrate* crate_;
840 std::vector<CorrelatorBandInput*> inputs_;
842 CorrelatorBand(CorrelatorCrate* crate,
unsigned bandNo);
845 virtual ~CorrelatorBand();
847 void initializeInputMap();
849 CorrelatorBandInput* getInput(
unsigned inputNo);
850 void validateInput(
unsigned inputNo);
857 class CorrelatorBandInput :
public ConfigurableDevice,
public ConnectableNode {
862 CorrelatorBand* band_;
866 CorrelatorCrateInput* crateInput_;
874 WalshColumn walshCol_;
876 CorrelatorBandInput(CorrelatorBand* band,
unsigned inputNo);
878 virtual ~CorrelatorBandInput();
880 void mapTo(CorrelatorCrateInput* input);
882 CorrelatorCrateInput* getCrateInput();
883 void validateCrateInput();
884 bool isConnectedToCrate();
889 AntennaIF* getAntennaIF();
894 AstroBandInput* getAstroBandInput();
895 void validateAstroBandInput();
896 bool isConnectedToAstroBand();
905 bool canBeConfiguredBy(AstroBandInfo* info);
906 void setOwnershipTo(AstroBandInfo* info);
907 void removeFromOwnership(
unsigned astroBandNo);
909 friend std::ostream& operator<<(std::ostream& os,
const CorrelatorBandInput& input);
921 SwitchyardConfiguration* conf_;
925 static const unsigned nBandMax_;
929 static const unsigned nInputMax_;
947 std::vector<AstroBandInput*> inputs_;
955 SubarrayId subarrayId_;
959 void clear(
CorrelatorType type=CORR_ALL, SubarrayId saId=SA_NONE);
961 AstroBandInput* getInput(
unsigned inputNo);
962 void validateInput(
unsigned inputNo);
964 SwitchyardConfiguration* getSwitchyardConfiguration();
965 void validateSwitchyardConfiguration();
967 AstroBand(
unsigned bandNo_);
968 AstroBand(
const AstroBand& band);
969 AstroBand(AstroBand& band);
971 virtual ~AstroBand();
975 void operator=(
const AstroBand& band);
976 void operator=(AstroBand& band);
978 void initialize(
unsigned bandNo);
979 void initializeInputMap();
981 void addBoard(FpgaBoard* part);
986 static std::vector<unsigned> getAstroBandNos(
CorrelatorType type);
989 class AstroBandInfo {
991 AstroBandConfiguration* astroBandConf_;
992 unsigned astroBandNo_;
994 unsigned nDevicesConfigured_;
996 sza::util::BitMask conflictMask_;
998 unsigned antConflictMask_;
999 unsigned conflictedSubarrayId_;
1000 SubarrayId subarrayId_;
1005 bool checkCurrentlyAllowed_;
1007 AstroBandInfo(
unsigned astroBandNo, SubarrayId saId=SA_ANY);
1011 static void incrementConfiguredDevices(AstroBandInfo* info);
1012 static void registerConflict(AstroBandInfo* info, Switch* sw);
1013 static void registerConflict(AstroBandInfo* info, Digitizer* dig);
1014 static void registerConflict(AstroBandInfo* info, CorrelatorCrateInput* input);
1015 static void registerConflict(AstroBandInfo* info, CorrelatorBandInput* input);
1016 static void registerConflict(AstroBandInfo* info, Antenna* ant);
1017 static void registerConflict(AstroBandInfo* info, FpgaBoard* part);
1019 static bool isOk(AstroBandInfo* info);
1020 static bool isConflicted(AstroBandInfo* info);
1021 static std::string listConflictedBands(AstroBandInfo* info);
1022 static std::string listConflictedAntennas(AstroBandInfo* info);
1024 friend std::ostream& operator<<(std::ostream& os,
const AstroBandInfo& info);
1027 std::ostream& operator<<(std::ostream& os,
const AstroBandInfo& info);
1033 class AstroBandInput :
public ConnectableNode {
1057 CorrelatorCrateInput* getCrateInput();
1058 void validateCrateInput();
1059 bool isConnectedToCrate();
1062 CorrelatorBandInput* getBandInput();
1063 void validateBandInput();
1064 bool isConnectedToBand();
1067 AntennaIF* getAntennaIF();
1069 AstroBandInput(AstroBand* parent,
unsigned inputNo_);
1070 virtual ~AstroBandInput();
1072 bool isUsedByConfiguredAstroBand();
1076 void mapFrom( ConnectableNode* node,
CorrelatorType type=CORR_ALL);
1077 void clearFrom(ConnectableNode* node,
CorrelatorType type=CORR_ALL);
1079 friend std::ostream& operator<<(std::ostream& os,
const AstroBandInput& input);
1086 class Antenna :
public ConfigurableDevice {
1099 WalshColumn walshCol_;
1103 SubarrayId subarrayId_;
1107 std::map<SplitterChannelId, AntennaIF*> ifMap_;
1111 sza::util::BitMask astroBandMask_;
1115 Antenna(
unsigned carmaId, AntennaType type);
1116 Antenna(
const Antenna& ant);
1117 Antenna(Antenna& ant);
1121 void operator=(
const Antenna& ant);
1122 void operator=(Antenna& ant);
1124 void initialize(
unsigned carmaId, AntennaType type);
1125 void initializeIfMap(AntennaType type);
1130 bool canBeConfiguredBy(AstroBandInfo* info);
1131 void setOwnershipTo(AstroBandInfo* info);
1132 void removeFromOwnership(AstroBandInfo* info);
1136 std::string printDown();
1138 friend std::ostream& operator<<(std::ostream& os,
const Antenna& ant);
1145 class SwitchSetting {
1148 SwitchChannelId channel_;
1155 class BlockDownconverterSetting {
1159 BlockDownconverterInputType input_;
1166 class WalshColumnAssignment {
1169 unsigned walshColNo_;
1176 class FpgaBoard :
public ConfigurableDeviceMultiAstroBand,
public ConnectableNode {
1179 FpgaBoard(SignalPathMap* spm,
unsigned inputNo, std::string name,
CorrelatorType type);
1180 virtual ~FpgaBoard();
1192 std::vector<CorrelatorBandInput*> corrBandInputs_;
1197 AstroBandConfiguration* astroBandConf_;
1201 bool canBeConfiguredBy(AstroBandInfo* info);
1202 void setOwnershipTo(AstroBandInfo* info);
1203 void removeFromOwnership(
unsigned astroBandNo);
1205 friend std::ostream& operator<<(std::ostream& os,
const FpgaBoard& brd);
1213 class AstroBandInputMapping {
1216 std::string astroSpec_;
1217 std::string inputSpec_;
1219 AstroBandInputMapping(std::string spec1, std::string spec2);
1220 AstroBandInputMapping(
const AstroBandInputMapping& conf);
1221 AstroBandInputMapping(AstroBandInputMapping& conf);
1223 void operator=(
const AstroBandInputMapping& conf);
1224 void operator=(AstroBandInputMapping& conf);
1226 virtual ~AstroBandInputMapping();
1233 class AstroBandConfiguration {
1240 std::vector<AstroBandInputMapping> inputMappings_;
1242 AstroBandConfiguration();
1243 AstroBandConfiguration(
const AstroBandConfiguration& conf);
1244 AstroBandConfiguration(AstroBandConfiguration& conf);
1246 void operator=(
const AstroBandConfiguration& conf);
1247 void operator=(AstroBandConfiguration& conf);
1249 virtual ~AstroBandConfiguration();
1257 class AntennaIFMapping {
1260 std::string ifSpec_;
1261 std::string inputSpec_;
1263 AntennaIFMapping(std::string ifSpec, std::string inputSpec);
1264 AntennaIFMapping(
const AntennaIFMapping& conf);
1265 AntennaIFMapping(AntennaIFMapping& conf);
1267 void operator=(
const AntennaIFMapping& conf);
1268 void operator=(AntennaIFMapping& conf);
1270 virtual ~AntennaIFMapping();
1277 class SwitchyardConfiguration {
1286 std::vector<AntennaIFMapping> ifMappings_;
1290 AstroBandConfiguration* astroBandConf_;
1292 AstroBandConfiguration* getAstroBandConfiguration();
1293 void validateAstroBandConfiguration();
1295 SwitchyardConfiguration();
1296 SwitchyardConfiguration(
const SwitchyardConfiguration& conf);
1297 SwitchyardConfiguration(SwitchyardConfiguration& conf);
1299 void operator=(
const SwitchyardConfiguration& conf);
1300 void operator=(SwitchyardConfiguration& conf);
1302 virtual ~SwitchyardConfiguration();
1309 class Digitizer :
public ConfigurableDeviceMultiAstroBand,
public ConnectableNode {
1322 unsigned digitizerNo_;
1327 std::vector<AstroBandInput*> astroBandInputs_;
1331 std::vector<FpgaBoard*> bandFormers_;
1333 bool isUsedByConfiguredAstroBand();
1335 std::string printDown();
1337 Digitizer(SignalPathMap* spm,
CorrelatorType type,
unsigned digitizerNo);
1342 AntennaIF* getAntennaIF();
1346 void mapTo(ConnectableNode* toNode,
CorrelatorType type=CORR_ALL);
1347 void clearTo(ConnectableNode* toNode,
CorrelatorType type=CORR_ALL);
1348 void mapFrom(ConnectableNode* fromNode,
CorrelatorType type=CORR_ALL);
1352 bool canBeConfiguredBy(AstroBandInfo* info);
1354 friend std::ostream& operator<<(std::ostream& os,
const Digitizer& dig);
1366 static const unsigned nSza_;
1367 static const unsigned nBima_;
1368 static const unsigned nOvro_;
1369 static const unsigned nAnt_;
1371 static const unsigned nSubarray_;
1373 static const unsigned nSl_;
1374 static const unsigned nWb_;
1376 static const unsigned nSwitch_;
1377 static const unsigned nBdc_;
1379 static const unsigned nDigitizer_;
1391 void initializeCableMap(std::string fileName);
1395 void configureAstroBand(
unsigned bandNo, std::string confName,
1407 void addAntenna(
unsigned antNo, SubarrayId subarrayId);
1408 void removeAntenna(
unsigned antNo, SubarrayId subarrayId);
1418 bool removeCorrelator(
CorrelatorType type, SubarrayId subarrayId);
1427 void checkAstroBandConfiguration(
unsigned bandNo, std::string confName,
1432 bool astroBandConfigurationIsValid(
unsigned bandNo, std::string confName,
1437 bool astroBandConfigurationSpecifiesMapping(
unsigned bandNo, std::string confName, SubarrayId saId,
CorrelatorType type);
1441 void mapCorrToAstroBand(std::string corrSpec, std::string astroSpec,
1442 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1446 void mapDigitizerToAstroBand(std::string digSpec, std::string astroSpec,
1447 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1453 void mapBandToAstroBand(std::string bandSpec, std::string astroSpec,
1454 bool doMapping,
unsigned baseIndex,
CorrelatorType type, AstroBandInfo* info);
1458 void hardwareMapAntennaIFToSwitch(std::string antennaIFSpec, std::string switchChannelSpec);
1463 void hardwareMapAntennaIFToDigitizer(std::string antennaIFSpec, std::string digSpec);
1468 void mapAntennaIFToBdc(std::string antennaIFSpec, std::string bdcSpec,
1469 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1473 void mapAntennaIFToCorr(std::string antennaIFSpec, std::string corrSpec,
1474 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1479 void mapAntennaIFToDigitizer(std::string antennaIFSpec, std::string digitizerSpec,
1480 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1485 void mapAntennaIFToInput(std::string antennaIFSpec, std::string inputSpec,
1486 bool doMapping=
true,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1490 void loadConfiguration(std::string fileName, std::string confName, std::string astroBandConfName);
1494 void selectConfiguration(std::string confName,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1495 void selectAstroBandConfiguration(std::string confName, AstroBandInfo* info=0,
CorrelatorType type=CORR_ALL);
1499 void validateConfiguration(std::string confName,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1500 void validateConfiguration(SwitchyardConfiguration& conf,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1504 void validateAstroBandConfiguration(std::string confName,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1505 void validateAstroBandConfiguration(AstroBandConfiguration& conf,
unsigned baseIndex=0,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1510 void clearAstroBandConfiguration(
unsigned bandNo, SubarrayId saId=SA_NONE,
CorrelatorType type=CORR_ALL);
1514 void setWalshColumn(std::string antName,
unsigned walshColNo);
1518 void clearWalshColumn(std::string antName);
1522 bool canAssertSwitchPosition(SwitchSetting swSet);
1526 std::vector<WalshColumnAssignment> getWalshColumnAssignment(
unsigned antNo=0);
1531 std::vector<CorrelatorCrateSpec> getActiveCorrelatorCrates(
CorrelatorType type=CORR_ALL);
1536 std::vector<CorrelatorCrateInputSpec> getCorrelatorCrateInputMap(CorrelatorCrateSpec crate);
1541 std::vector<CorrelatorBandSpec> getCorrelatorBands(
unsigned astroBandNo);
1546 std::vector<CorrelatorBandSpec> getActiveCorrelatorBands(
CorrelatorType type=CORR_ALL);
1551 std::vector<CorrelatorBandInputSpec> getCorrelatorBandInputMap(CorrelatorBandSpec band);
1555 std::vector<unsigned> getActiveAstroBandNos(
CorrelatorType type);
1560 std::vector<unsigned> getAstroBandNosForConfiguration(std::string confName,
1574 std::vector<AntennaSpec> getAntennas(
unsigned astroBandNo,
bool all=
true);
1586 std::vector<PolarizationType>
1587 getPolarizations(
unsigned astroBandNo,
bool all);
1591 SwitchyardConfiguration& getConfiguration(std::string name);
1595 void addConfiguration(SwitchyardConfiguration& conf, std::string confName, std::string astroBandConfName);
1599 AstroBandConfiguration& getAstroBandConfiguration(std::string name);
1603 void addAstroBandConfiguration(std::string name, AstroBandConfiguration& conf);
1607 std::vector<SwitchSetting>
1608 getIFSwitchSettings(
unsigned astroBandNo=0);
1612 std::vector<BlockDownconverterSetting>
1613 getBdcSettings(
unsigned astroBandNo=0);
1617 unsigned getWalshColumn(
unsigned antNo);
1621 std::string printDown();
1622 std::string printUp();
1624 std::string printDownAntenna(std::string antName);
1625 std::string printDownSwitch(std::string switchName);
1627 static std::string fill(
char fillChar,
unsigned nChar);
1632 friend std::ostream& operator<<(std::ostream& os,
const SignalPathMap& swMap);
1638 std::vector<Correlator*> correlators_;
1639 std::map<CorrelatorType, Correlator*> correlatorMap_;
1641 std::vector<FpgaBoard*> fpgaBoards_;
1645 std::vector<Switch*> switches_;
1649 std::map<std::string, Switch*> switchMap_;
1653 std::vector<Antenna*> antennas_;
1657 std::map<std::string, Antenna*> antennaMap_;
1661 std::vector<BlockDownconverter*> bdcs_;
1665 std::map<std::string, BlockDownconverter*> bdcMap_;
1669 std::vector<CorrelatorCrate*> crates_;
1673 std::map<std::string, CorrelatorCrate*> crateMap_;
1677 std::vector<AstroBand*> astroBands_;
1681 std::map<unsigned, AstroBand*> astroBandMap_;
1686 std::vector<CorrelatorBand*> corrBands_;
1690 std::map<std::string, CorrelatorBand*> corrBandMap_;
1694 std::vector<Digitizer*> digitizers_;
1698 std::map<std::string, Digitizer*> digitizerMap_;
1702 unsigned walshColMaskSl_;
1703 unsigned walshColMaskWb_;
1704 unsigned walshColMaskC3g_;
1708 std::map<std::string, SwitchyardConfiguration> knownConfigurations_;
1712 std::map<std::string, AstroBandConfiguration> knownAstroBandConfigurations_;
1714 void setWalshColumn(Antenna* ant,
unsigned walshColNo);
1717 bool isSetInWalshColumnMask(WalshColumn& wf,
CorrelatorType type);
1721 void propagateWalshColumnAssignment(Antenna* antProp);
1722 void propagateWalshColumnAssignment(Antenna* antProp,
unsigned walshColNo);
1723 void propagateWalshColumnAssignmentToCrates(Antenna* antProp,
unsigned walshColNo);
1724 void propagateWalshColumnAssignmentToBands(Antenna* antProp,
unsigned walshColNo);
1726 void assignFreeWalshColumns();
1727 void assignFreeWalshColumnsToCrates();
1728 void assignFreeWalshColumnsToBands();
1730 void assignHardwiredWalshColumns();
1731 void assignHardwiredCorrelatorWalshColumns();
1732 void assignHardwiredAntennaWalshColumns();
1738 void configureWalshColumns();
1742 void initializeAntennaMap();
1743 void initializeSwitchMap();
1744 void initializeCrateMap();
1745 void initializeDigitizerMap();
1746 void initializeCorrelatorMap();
1747 void initializeFpgaBoardMap();
1749 void initializeAstroBands();
1751 void associateBdcBandsAndCrates();
1752 void mapBdcBandToCrate(BlockDownconverter* bdc, Band* band);
1756 void initializeDefaultCableMap();
1757 void clearCableMap();
1761 void initializeKnownConfigurations();
1763 std::string listUnconflictedConfigurations(
CorrelatorType type, AstroBandInfo& info);
1767 void addLLConfiguration();
1768 void addRRConfiguration();
1769 void addCarma23Configuration();
1770 void addFullStokesConfiguration();
1774 void initializeKnownAstroBandConfigurations();
1778 void addSingleAstroBandConfiguration();
1779 void addCarma23AstroBandConfiguration();
1780 void addFullStokesAstroBandConfiguration();
1781 void addDualPolAstroBandConfiguration();
1787 void hardwareMapAntennaIFToSwitch(
unsigned carmaId, PolarizationType type, SplitterChannelId splitterChannel,
1788 unsigned switchId, SwitchChannelId switchChannel);
1793 void hardwareMapAntennaIFToDigitizer(
unsigned carmaId, PolarizationType type, SplitterChannelId splitterChannelId,
1794 std::string digitizerId);
1799 void mapAntennaIFToBdc(
unsigned carmaId, PolarizationType polType, SplitterChannelId scId,
1800 unsigned bdcIndex, std::vector<unsigned>& bandIndices,
1801 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1803 void mapAntennaIFToBdc(
unsigned carmaId, PolarizationType polType, SplitterChannelId scId,
1804 unsigned bdcIndex,
unsigned bandNo,
1805 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1810 void mapAntennaIFToCorr(
unsigned carmaId, PolarizationType polType, SplitterChannelId scId,
1811 std::string crateName,
unsigned inputIndex,
1812 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1817 void mapAntennaIFToDigitizer(
unsigned carmaId, PolarizationType polType, SplitterChannelId scId,
1818 std::string digitizerName,
1819 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1824 void mapCorrInputToAstroBandInput(std::string crateName,
unsigned crateInputNo,
1825 unsigned astroBandNo,
unsigned astroBandInputNo,
1826 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1830 void mapBandInputToAstroBandInput(std::string bandName,
unsigned bandInputNo,
1831 unsigned astroBandNo,
unsigned astroBandInputNo,
1836 void mapDigitizerToAstroBandInput(std::string digId,
1837 unsigned astroBandNo,
unsigned astroBandInputNo,
1838 bool doMapping=
true,
CorrelatorType type=CORR_ALL, AstroBandInfo* info=0);
1842 void validateAntennaIFToBdcMapping(std::string ifSpec, std::string bdcSpec,
unsigned baseIndex=0);
1846 void validateAntennaIFToCorrMapping(std::string ifSpec, std::string corrSpec,
unsigned baseIndex=0);
1850 void validateAntennaIFToInputMapping(std::string ifSpec, std::string inputSpec,
unsigned baseIndex=0);
1858 Antenna* getAntenna(std::string antName);
1859 Antenna* getAntenna(
unsigned antNo);
1860 void validateAntenna(std::string antName);
1861 void validateAntenna(
unsigned antNo);
1865 AstroBand* getAstroBand(
unsigned astroBandNo);
1866 void validateAstroBand(
unsigned astroBandNo);
1870 BlockDownconverter* getBdc(std::string antName);
1871 BlockDownconverter* getBdc(
unsigned bdcNo);
1872 void validateBdc(std::string bdcName);
1873 void validateBdc(
unsigned bdcNo);
1879 CorrelatorBand* getCorrBand(
CorrelatorType type,
unsigned bandNo);
1880 CorrelatorBand* getCorrBand(std::string bandName);
1882 void validateCrate(std::string crateName);
1883 void validateCorrBand(std::string bandName);
1887 Switch* getSwitch(
unsigned switchNo);
1888 Switch* getSwitch(std::string switchName);
1889 void validateSwitch(std::string switchName);
1893 Digitizer* getDigitizer(std::string digitizerName);
1894 Digitizer* getDigitizer(
unsigned digitizerNo);
1895 void validateDigitizer(std::string digitizerName);
1897 std::vector<SplitterChannelId>
1898 getDefaultSplitterChannelsForPolarization(PolarizationType type);
1904 void checkArguments(
unsigned carmaId, PolarizationType type, SplitterChannelId splitterChannel,
1905 unsigned switchId, SwitchChannelId switchChannel);
1907 void checkArguments(
unsigned carmaId, PolarizationType type, SplitterChannelId splitterChannel,
1908 std::string digitizerId);
1910 void parseAstroBandSpecification(std::string astroSpec,
1911 std::vector<unsigned>& astroBandIndices, std::vector<unsigned>& astroBandInputIndices,
1912 unsigned baseIndex,
bool actualIndex);
1914 void parseCorrBandSpecification(std::string bandSpec,
1915 std::vector<std::string>& bandNames,
1916 std::vector<unsigned>& inputIndices,
1920 void parseIfSpecification(std::string ifSpec, PolarizationType& type,
1921 std::vector<unsigned>& carmaIds, std::vector<SplitterChannelId>& channels);
1923 void parseSwitchSpecification(std::string switchSpec,
1924 std::vector<unsigned>& switchIds, std::vector<SwitchChannelId>& channels);
1926 void parseDigitizerSpecification(std::string digSpec, std::vector<std::string>& digIds,
1927 unsigned baseIndex=0,
bool actualIndex=
true);
1929 void parseBdcSpecification(std::string bdcSpec, std::vector<unsigned>& bdcIndices, std::vector<unsigned>& bandIndices,
1930 unsigned baseIndex=0,
bool actualIndex=
true);
1932 void parseCorrSpecification(std::string corrSpec, std::vector<std::string>& crateNames, std::vector<unsigned>& inputIndices,
1933 unsigned baseIndex=0,
bool actualIndex=
true);
1935 std::vector<unsigned> extractIndexRange(sza::util::String& antStr,
unsigned lowestValid,
unsigned highestValid,
1936 unsigned baseIndex=0,
bool actualIndex=
true);
1938 unsigned parseIndexExpression(sza::util::String& str,
1939 unsigned baseIndex,
unsigned actualIndex,
1940 unsigned lowestValid,
unsigned highestValid);
1942 void parseIndexOperands(sza::util::String& str,
unsigned& op1,
unsigned& op2, std::string op,
1943 unsigned baseIndex,
unsigned actualIndex,
1944 unsigned lowestValid,
unsigned highestValid);
1946 void addIndex(std::vector<unsigned>& indices,
unsigned index,
unsigned lowestValid,
unsigned highestValid);
1948 unsigned firstEvenIndex(
unsigned lowestValid,
unsigned highestValid);
1949 unsigned firstOddIndex(
unsigned lowestValid,
unsigned highestValid);
1951 static SplitterChannelId splitterChannelNumberToChannelId(
unsigned iChan);
1952 static SwitchChannelId switchChannelNumberToChannelId(
unsigned iChan);
1953 static unsigned switchChannelIdToChannelNumber(SwitchChannelId);
1955 static std::string corrTypeAndCrateNoToCrateName(
CorrelatorType type,
unsigned crateNo);
1956 static std::string corrTypeAndBandNoToCorrBandName(
CorrelatorType type,
unsigned bandNo);
1957 static std::string antNoToAntName(
unsigned antNo);
1965 std::ostream& operator<<(std::ostream& os,
const Antenna& ant);
1966 std::ostream& operator<<(std::ostream& os,
const AntennaIF& antIf);
1968 std::ostream& operator<<(std::ostream& os,
const Switch& sw);
1969 std::ostream& operator<<(std::ostream& os,
const SwitchChannel& swChan);
1971 std::ostream& operator<<(std::ostream& os,
const BlockDownconverterInput& bdcInput);
1973 std::ostream& operator<<(std::ostream& os,
const CorrelatorType& corrType);
1975 std::ostream& operator<<(std::ostream& os,
const SignalPathMap& swMap);
1977 std::ostream& operator<<(std::ostream& os,
const WalshColumn& wc);
1981 std::ostream& operator<<(std::ostream& os,
const AstroBandInput& input);
1983 std::ostream& operator<<(std::ostream& os,
const CorrelatorBandInput& input);
1985 std::ostream& operator<<(std::ostream& os,
const Digitizer& dig);
1987 std::ostream& operator<<(std::ostream& os,
const FpgaBoard& brd);
1994 #endif // End #ifndef CARMA_SWITCHYARD_SIGNALPATHMAP_H
Base-class to encapsulate a connectable node.
Tagged: Tue Mar 6 16:39:02 PST 2012.
Class to encapsulate a device that can be configured, and therefore associated with multiple configur...
A class to encapsulate the switchyard cable map.
CorrelatorType
Enum to encapsulate a correlator type. These.
AntennaType
Enumeration of possible types for antennas.
AntennaType
Enumeration of possible types for antennas.
ConfigurableDevice()
Default constructor.
Class to encapsulate a correlator crate.
Class to encapsulate a device that can be configured, and therefore associated with a configuring Ast...
Class to encapsulate a correlator.
Tagged: Wed May 12 09:30:13 PDT 2004.