2 * Copyright (c) 2014-2015 ARM Limited
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * Authors: Andreas Sandberg
20 #ifndef _LIBNOMALIMODEL_JOBCONTROL_HH
21 #define _LIBNOMALIMODEL_JOBCONTROL_HH
25 #include "gpublock.hh"
34 * Minimal GPU job control implementation.
36 * This class implements the job control block of a Midgard style
37 * GPU. The job control block mainly coordinates interrupt delivery
38 * and register mappings for the different job slots within the
39 * block. The actual job slots are implemented by the JobSlot class.
47 JobControl(GPU &_gpu);
48 virtual ~JobControl();
50 void reset() override;
52 uint32_t readReg(RegAddr idx) override;
53 void writeReg(RegAddr idx, uint32_t value) override;
55 uint32_t readRegRaw(RegAddr idx) override;
56 void writeRegRaw(RegAddr idx, uint32_t value) override;
61 * Calling this method raises the job done interrupt for a
62 * specific job slot. This is typically called from the job slot
63 * running the job chain.
65 * @param slot Job slot number.
67 void jobDone(uint8_t slot);
71 * Calling this method raises the job failed interrupt for a
72 * specific job slot. This is typically called from the job slot
73 * running the job chain.
75 * @param slot Job slot number.
77 void jobFailed(uint8_t slot);
81 * Update the state of the job slot state snapshot register.
83 * @param jobs Bit mask representing which job slots to update.
85 void updateJsState(uint16_t jobs);
87 void onInterrupt(int set) override;
89 /** Job slots belonging to this job control block */
90 std::vector<JobSlot> slots;
95 #endif // _LIBNOMALIMODEL_JOBCONTROL_HH