packet.hh (10569:ffd46545b284) packet.hh (10570:dcb908e40547)
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 171 unchanged lines hidden (view full) ---

180 bool isRead() const { return testCmdAttrib(IsRead); }
181 bool isWrite() const { return testCmdAttrib(IsWrite); }
182 bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
183 bool isRequest() const { return testCmdAttrib(IsRequest); }
184 bool isResponse() const { return testCmdAttrib(IsResponse); }
185 bool needsExclusive() const { return testCmdAttrib(NeedsExclusive); }
186 bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
187 bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 171 unchanged lines hidden (view full) ---

180 bool isRead() const { return testCmdAttrib(IsRead); }
181 bool isWrite() const { return testCmdAttrib(IsWrite); }
182 bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
183 bool isRequest() const { return testCmdAttrib(IsRequest); }
184 bool isResponse() const { return testCmdAttrib(IsResponse); }
185 bool needsExclusive() const { return testCmdAttrib(NeedsExclusive); }
186 bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
187 bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
188
189 /**
190 * Check if this particular packet type carries payload data. Note
191 * that this does not reflect if the data pointer of the packet is
192 * valid or not.
193 */
188 bool hasData() const { return testCmdAttrib(HasData); }
189 bool isLLSC() const { return testCmdAttrib(IsLlsc); }
190 bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
191 bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
192 bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
193 testCmdAttrib(IsHWPrefetch); }
194 bool isError() const { return testCmdAttrib(IsError); }
195 bool isPrint() const { return testCmdAttrib(IsPrint); }

--- 717 unchanged lines hidden (view full) ---

913 allocate()
914 {
915 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
916 flags.set(DYNAMIC_DATA);
917 data = new uint8_t[getSize()];
918 }
919
920 /**
194 bool hasData() const { return testCmdAttrib(HasData); }
195 bool isLLSC() const { return testCmdAttrib(IsLlsc); }
196 bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
197 bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
198 bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
199 testCmdAttrib(IsHWPrefetch); }
200 bool isError() const { return testCmdAttrib(IsError); }
201 bool isPrint() const { return testCmdAttrib(IsPrint); }

--- 717 unchanged lines hidden (view full) ---

919 allocate()
920 {
921 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
922 flags.set(DYNAMIC_DATA);
923 data = new uint8_t[getSize()];
924 }
925
926 /**
921 * Check a functional request against a memory value represented
922 * by a base/size pair and an associated data array. If the
923 * functional request is a read, it may be satisfied by the memory
924 * value. If the functional request is a write, it may update the
925 * memory value.
926 */
927 bool checkFunctional(Printable *obj, Addr base, bool is_secure, int size,
928 uint8_t *data);
929
930 /**
931 * Check a functional request against a memory value stored in
927 * Check a functional request against a memory value stored in
932 * another packet (i.e. an in-transit request or response).
928 * another packet (i.e. an in-transit request or
929 * response). Returns true if the current packet is a read, and
930 * the other packet provides the data, which is then copied to the
931 * current packet. If the current packet is a write, and the other
932 * packet intersects this one, then we update the data
933 * accordingly.
933 */
934 bool
934 */
935 bool
935 checkFunctional(PacketPtr other)
936 checkFunctional(PacketPtr other)
936 {
937 {
937 uint8_t *data = other->hasData() ? other->getPtr<uint8_t>() : NULL;
938 // all packets that are carrying a payload should have a valid
939 // data pointer
938 return checkFunctional(other, other->getAddr(), other->isSecure(),
940 return checkFunctional(other, other->getAddr(), other->isSecure(),
939 other->getSize(), data);
941 other->getSize(),
942 other->hasData() ?
943 other->getPtr<uint8_t>() : NULL);
940 }
941
942 /**
944 }
945
946 /**
947 * Check a functional request against a memory value represented
948 * by a base/size pair and an associated data array. If the
949 * current packet is a read, it may be satisfied by the memory
950 * value. If the current packet is a write, it may update the
951 * memory value.
952 */
953 bool
954 checkFunctional(Printable *obj, Addr base, bool is_secure, int size,
955 uint8_t *_data);
956
957 /**
943 * Push label for PrintReq (safe to call unconditionally).
944 */
945 void
946 pushLabel(const std::string &lbl)
947 {
948 if (isPrint())
949 safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
950 }

--- 24 unchanged lines hidden ---
958 * Push label for PrintReq (safe to call unconditionally).
959 */
960 void
961 pushLabel(const std::string &lbl)
962 {
963 if (isPrint())
964 safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
965 }

--- 24 unchanged lines hidden ---