OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [support/] [sched.h] - Blame information for rev 1688

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 807 markom
/* sched.h -- Abstract entities header file handling job scheduler
2
   Copyright (C) 2001 Marko Mlinar, markom@opencores.org
3 1390 nogj
   Copyright (C) 2005 György `nog' Jeney, nog@sdf.lonestar.org
4 807 markom
 
5
This file is part of OpenRISC 1000 Architectural Simulator.
6
 
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
 
21
#ifndef _SCHED_H_
22
#define _SCHED_H_
23
 
24 1688 nogj
void sched_init(void);
25
void sched_reset(void);
26
void sched_next_insn(void (*func)(void *), void *dat);
27
void sched_find_remove(void (*job_func)(void *), void *dat, const char *func);
28
void sched_add(void (*job_func)(void *), void *job_param, int32_t job_time,
29
               const char *func);
30
#define SCHED_ADD(job_func, job_param, job_time) sched_add(job_func, job_param, job_time, #job_func)
31
#define SCHED_FIND_REMOVE(f, p) sched_find_remove(f, p, __FUNCTION__)
32 1390 nogj
 
33 807 markom
/* Structure for holding one job entry */
34
struct sched_entry {
35 1390 nogj
  int32_t time;          /* Clock cycles before job starts */
36
  void *param;           /* Parameter to pass to the function */
37 1365 nogj
  void (*func)(void *);  /* Function to call when time reaches 0 */
38 1390 nogj
  struct sched_entry *next;
39 807 markom
};
40
 
41
/* Heap of jobs */
42
struct scheduler_struct {
43 1390 nogj
  struct sched_entry *free_job_queue;
44
  struct sched_entry *job_queue;
45 807 markom
};
46
 
47
extern struct scheduler_struct scheduler;
48
 
49
 
50 1452 nogj
/* If we are not running with dynamic execution, then do_scheduler will be
51
 * inlined and this declaration will be useless (it will also fail to compile)*/
52
#if DYNAMIC_EXECUTION
53
void do_scheduler (void);
54
#endif
55
 
56 807 markom
#endif /* _SCHED_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.