From 8aad5b90950244fec6ba102975916f221e696f33 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 5 Jun 2024 19:33:18 +0100 Subject: [PATCH] Tidying --- .../AVR8/Services/ValidationService.php | 12 +++++++----- .../Services/ValidationService.php | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php b/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php index 90d43a65..8d7f355e 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php +++ b/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php @@ -87,7 +87,7 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat } /* - * GDB allows for a maximum SP size of 2 bytes. We enforce this here. + * GDB allows for a maximum SP size of 2 bytes. We confirm this here. * * For more, see GDB's read/write register packets for AVR targets. */ @@ -128,8 +128,6 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat $this->validateDebugWireParameters($tdf->getDebugWireParameters(), $tdf) ); - $failures = array_merge($failures, $this->validateIspParameters($tdf->getIspParameters())); - if (!in_array(AvrPhysicalInterface::ISP, $physicalInterfaces)) { $failures[] = 'Missing ISP interface for debugWIRE target'; } @@ -151,6 +149,10 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat } } + if (in_array(AvrPhysicalInterface::ISP, $physicalInterfaces)) { + $failures = array_merge($failures, $this->validateIspParameters($tdf->getIspParameters())); + } + if ( in_array(AvrPhysicalInterface::JTAG, $debugPhysicalInterfaces) && $family == AvrFamily::MEGA @@ -340,7 +342,7 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat /* * Bloom removes the IO memory segment offset when sending some of these params to the debug tool. This means - * we assume that the offset has already been applied to the params. We enforce this here. + * we assume that the offset has already been applied to the params. We confirm this here. */ if (($ioMemorySegment = $tdf->getIoMemorySegment()) instanceof MemorySegment) { if ($parameters->osccalAddress < $ioMemorySegment->startAddress) { @@ -530,7 +532,7 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat /* * Bloom removes the IO memory segment offset when sending some of these params to the debug tool. This means - * we assume that the offset has already been applied to the params. We enforce this here. + * we assume that the offset has already been applied to the params. We confirm this here. */ if (($ioMemorySegment = $tdf->getIoMemorySegment()) instanceof MemorySegment) { if ($parameters->osccalAddress < $ioMemorySegment->startAddress) { diff --git a/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php b/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php index c6a9b765..34c4b112 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php +++ b/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php @@ -932,7 +932,7 @@ class ValidationService $failures = []; foreach ($targetPeripheral->registerGroups as $registerGroup) { - $failures = array_merge($failures, $this->validateTargetRegisterGroup($registerGroup, $tdf));; + $failures = array_merge($failures, $this->validateTargetRegisterGroup($registerGroup, $tdf)); } return array_map( @@ -952,6 +952,7 @@ class ValidationService !empty($registerGroup->addressSpaceKey) && ($addressSpace = $tdf->getAddressSpace($registerGroup->addressSpaceKey)) instanceof AddressSpace ) { + // Ensure that all target registers reside in a known memory segment and do not span multiple segments foreach ($registerGroup->registers as $register) { $intersectingSegments = $addressSpace->findIntersectingMemorySegments( $register->address,